dump_schema_information: explicitly order inserts into schema_migrations #3477
Merged
josevalim merged 1 commit intorails:masterfrom Oct 31, 2011
Merged
Conversation
Contributor
|
+1. I have seen this issue myself. Could you please write a test for it? Thanks! |
…ons table This change reduces churn in the db/development_structure.sql file when using :sql as active_record.schema_format, and makes comparing diffs much easier. Test ensures the output SQL-statements are lexically ordered by version.
Contributor
Author
|
Test added - took the liberty of updating the patch with test added. Does this also look sane to you? |
josevalim
added a commit
that referenced
this pull request
Oct 31, 2011
…ased dump_schema_information: explicitly order inserts into schema_migrations
Contributor
|
Looks good, merged. |
Contributor
Author
|
Awesome, thank you @josevalim :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
dump_schema_information: now explicitly orders inserts into schema_migrations table by version valueWe use
active_record.schema_format = :sqlas our schema dump format, and thedb/development_structure.sqlsees quite a bit of trivial churn in the git history due to migrations having run in different orders, as migrations are created on different feature branches over time. With this trivial fix, only added/removed migrations will create changes to the schema dump file.The complete activerecord test suite with all database drivers pass with this change. Unfortunately, that doesn't say a big deal, as
dump_schema_informationis only called by thedb:structure:dumprake-task. Local manual testing does confirm the change, though.Comments on this change?