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_enumSchemaDumper (code).The nature is this: ARPGE redefines
SchemaDumper#tablesmethod, but it doesn’t further call methods liketable(which SchemaPlus redefines) and rather writes its statementscreate_enumdirectly into stream.This causes one of two problems:
schema_plus_corein Gemfile (=its redefinition oftablehappens earlier than ours), it manages to write to file directly, leading tocreate_enumstatements being higher in the file thanActiveRecord::Schema.define(which is postponed by Schema+ dumper). Solved by adjustment of#dumpmethod.schema_plus_core(=its redefinition oftablehappens later and nested in ours), it fails withNoMethodErrordue tonilpassed instead of the stream it tries to write to. Solved by adjustment of#tablesmethods.Two things to note:
activerecord-postgres_enum, might be broken with some other schema dumpers.