diff options
author | Rusty Geldmacher <russell.geldmacher@gmail.com> | 2017-05-12 11:40:31 -0400 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2017-05-15 18:19:12 -0500 |
commit | be1dd45200b1f21aec5b151d78ef402df9fa28e4 (patch) | |
tree | e62532603dcee2e68ae27a4373c3b3c99042772b /activerecord/test | |
parent | 7cc526beb5c1ecc509db9f607c26fabaed4b4027 (diff) | |
download | rails-be1dd45200b1f21aec5b151d78ef402df9fa28e4.tar.gz rails-be1dd45200b1f21aec5b151d78ef402df9fa28e4.tar.bz2 rails-be1dd45200b1f21aec5b151d78ef402df9fa28e4.zip |
Respect `ignore_tables` in Postgres structure dump
When using `sql` as the schema format, or even just doing `rake
db:structure:dump`, it would be good to respect the list of ignored
tables that has been configured.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/tasks/postgresql_rake_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/tasks/postgresql_rake_test.rb b/activerecord/test/cases/tasks/postgresql_rake_test.rb index 512388af6b..a2e968aedf 100644 --- a/activerecord/test/cases/tasks/postgresql_rake_test.rb +++ b/activerecord/test/cases/tasks/postgresql_rake_test.rb @@ -259,6 +259,14 @@ if current_adapter?(:PostgreSQLAdapter) end end + def test_structure_dump_with_ignore_tables + ActiveRecord::SchemaDumper.expects(:ignore_tables).returns(["foo", "bar"]) + + Kernel.expects(:system).with("pg_dump", "-s", "-x", "-O", "-f", @filename, "-T", "foo", "-T", "bar", "my-app-db").returns(true) + + ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename) + end + def test_structure_dump_with_schema_search_path @configuration["schema_search_path"] = "foo,bar" |