diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-07-16 20:01:27 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-16 20:01:27 -0300 |
commit | c1e38d68a2b1fcf1dd49c3bd58a604b928cd1234 (patch) | |
tree | 4893d7e9883f65ed3d5901429c9e7aacb9a6e01f | |
parent | 821f6975da0a67c57c48fb076961c6ff6c146ee8 (diff) | |
parent | 60ff98184e86044f9c2afe8b47a26b85cec1a3a2 (diff) | |
download | rails-c1e38d68a2b1fcf1dd49c3bd58a604b928cd1234.tar.gz rails-c1e38d68a2b1fcf1dd49c3bd58a604b928cd1234.tar.bz2 rails-c1e38d68a2b1fcf1dd49c3bd58a604b928cd1234.zip |
Merge pull request #25815 from greysteil/add-newline-between-structure-versions
Add newline between each migration in `structure.sql`
-rw-r--r-- | activerecord/CHANGELOG.md | 7 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 86d07580e8..5cbfe9aa6f 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,10 @@ +* Add newline between each migration in `structure.sql` + + Keeps schema migration inserts as a single commit, but allows for easier + git diff-ing. Fixes #25504. + + *Grey Baker*, *Norberto Lopes* + * The flag `error_on_ignored_order_or_limit` has been deprecated in favor of the current `error_on_ignored_order`. diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index 396cb0b07a..9e9ace49db 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -998,8 +998,8 @@ module ActiveRecord sm_table = ActiveRecord::Migrator.schema_migrations_table_name if supports_multi_insert? - sql = "INSERT INTO #{sm_table} (version) VALUES " - sql << versions.map {|v| "('#{v}')" }.join(', ') + sql = "INSERT INTO #{sm_table} (version) VALUES\n" + sql << versions.map {|v| "('#{v}')" }.join(",\n") sql << ";\n\n" sql else |