aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2017-05-15 19:39:13 -0500
committerGitHub <noreply@github.com>2017-05-15 19:39:13 -0500
commitd7a0d288fca496dcdad2261469c4e87af2354844 (patch)
tree86d74cb3c8aaba85ad4688e9a88bf12373b6fcbe /activerecord/lib/active_record/tasks/postgresql_database_tasks.rb
parent7cc526beb5c1ecc509db9f607c26fabaed4b4027 (diff)
parent701663e18c856d182265867fb50854d58a8b79d0 (diff)
downloadrails-d7a0d288fca496dcdad2261469c4e87af2354844.tar.gz
rails-d7a0d288fca496dcdad2261469c4e87af2354844.tar.bz2
rails-d7a0d288fca496dcdad2261469c4e87af2354844.zip
Merge pull request #29077 from rails/ignore-tables-in-sql-dump
Respect 'SchemaDumper.ignore_tables' in databases structure dump
Diffstat (limited to 'activerecord/lib/active_record/tasks/postgresql_database_tasks.rb')
-rw-r--r--activerecord/lib/active_record/tasks/postgresql_database_tasks.rb6
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)