diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2019-07-24 08:10:54 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-24 08:10:54 -0400 |
commit | 6cd364cfe5cc36b5754139967780f9f3b6ddd503 (patch) | |
tree | 373cd85394fa659cf4d1b9ea9f57488d29d8c704 /railties | |
parent | 53d326dc5d008859b560f975c541c65748244d32 (diff) | |
parent | 5c1f6d1ff655a4c49ddbebe65156c08c8e853b1d (diff) | |
download | rails-6cd364cfe5cc36b5754139967780f9f3b6ddd503.tar.gz rails-6cd364cfe5cc36b5754139967780f9f3b6ddd503.tar.bz2 rails-6cd364cfe5cc36b5754139967780f9f3b6ddd503.zip |
Merge pull request #36744 from freeletics/fix-db-prepare
Fixed db:prepare task to not touch schema when it is disabled
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/application/rake/dbs_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/railties/test/application/rake/dbs_test.rb b/railties/test/application/rake/dbs_test.rb index 79c521dbf6..c9931c45a6 100644 --- a/railties/test/application/rake/dbs_test.rb +++ b/railties/test/application/rake/dbs_test.rb @@ -630,6 +630,22 @@ module ApplicationTests assert_match(/CreateRecipes: migrated/, output) end end + + test "db:prepare does not touch schema when dumping is disabled" do + Dir.chdir(app_path) do + rails "generate", "model", "book", "title:string" + rails "db:create", "db:migrate" + + app_file "db/schema.rb", "Not touched" + app_file "config/initializers/disable_dumping_schema.rb", <<-RUBY + Rails.application.config.active_record.dump_schema_after_migration = false + RUBY + + rails "db:prepare" + + assert_equal("Not touched", File.read("db/schema.rb").strip) + end + end end end end |