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/lib/active_record/tasks | |
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/lib/active_record/tasks')
-rw-r--r-- | activerecord/lib/active_record/tasks/postgresql_database_tasks.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb b/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb index f1af90c1e8..7f1a768d8b 100644 --- a/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb +++ b/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb @@ -66,6 +66,12 @@ module ActiveRecord "--schema=#{part.strip}" end end + + ignore_tables = ActiveRecord::SchemaDumper.ignore_tables + if ignore_tables.any? + args += ignore_tables.flat_map { |table| ["-T", table] } + end + args << configuration["database"] run_cmd("pg_dump", args, "dumping") remove_sql_header_comments(filename) |