diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2012-03-18 02:33:33 -0700 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2012-03-18 02:33:33 -0700 |
commit | d9355bea0447e640de638e0a86b557e0d1a0425b (patch) | |
tree | ec6e2fd8a82b921f3c11bcf1e7a04dfabf549b73 | |
parent | 41815f5d6c096390246ef950e5cb2aa86a68960a (diff) | |
parent | f4f9ec153685d3a672588c5f5db85658a7fb6f76 (diff) | |
download | rails-d9355bea0447e640de638e0a86b557e0d1a0425b.tar.gz rails-d9355bea0447e640de638e0a86b557e0d1a0425b.tar.bz2 rails-d9355bea0447e640de638e0a86b557e0d1a0425b.zip |
Merge pull request #5493 from kennyj/fix_5435-32
[3-2-stable] Fix GH #5435. db:structure:dump should be re-enable.
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 1 | ||||
-rw-r--r-- | railties/test/application/rake_test.rb | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index b94df4262a..4985abc31a 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -407,6 +407,7 @@ db_namespace = namespace :db do if ActiveRecord::Base.connection.supports_migrations? File.open(filename, "a") { |f| f << ActiveRecord::Base.connection.dump_schema_information } end + db_namespace['structure:dump'].reenable end # desc "Recreate the databases from the structure.sql file" diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index 1d90671e44..4b39c7f5bc 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -138,5 +138,17 @@ module ApplicationTests end assert File.exists?(File.join(app_path, 'db', 'my_structure.sql')) end + + def test_rake_dump_structure_should_be_called_twice_when_migrate_redo + add_to_config "config.active_record.schema_format = :sql" + + output = Dir.chdir(app_path) do + `rails g model post title:string; + bundle exec rake db:migrate:redo 2>&1 --trace;` + end + + # expect only Invoke db:structure:dump (first_time) + assert_no_match(/^\*\* Invoke db:structure:dump\s+$/, output) + end end end |