Resolve conflict with other schema dumpers #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After switching to SchemaDumper 3.1.0, we have a conflict with
activerecord-postgres_enum
SchemaDumper (code).The nature is this: ARPGE redefines
SchemaDumper#tables
method, but it doesn’t further call methods liketable
(which SchemaPlus redefines) and rather writes its statementscreate_enum
directly into stream.This causes one of two problems:
schema_plus_core
in Gemfile (=its redefinition oftable
happens earlier than ours), it manages to write to file directly, leading tocreate_enum
statements being higher in the file thanActiveRecord::Schema.define
(which is postponed by Schema+ dumper). Solved by adjustment of#dump
method.schema_plus_core
(=its redefinition oftable
happens later and nested in ours), it fails withNoMethodError
due tonil
passed instead of the stream it tries to write to. Solved by adjustment of#tables
methods.Two things to note:
activerecord-postgres_enum
, might be broken with some other schema dumpers.