Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix GH #5435. db:structure:dump should be re-enable.

  • Loading branch information...
commit f4f9ec153685d3a672588c5f5db85658a7fb6f76 1 parent 41815f5
@kennyj kennyj authored
View
1  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"
View
12 railties/test/application/rake_test.rb
@@ -138,5 +138,17 @@ def test_rake_dump_structure_should_respect_db_structure_env_variable
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
Please sign in to comment.
Something went wrong with that request. Please try again.