diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-09-20 16:31:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-20 16:31:44 -0400 |
commit | f3c359800a226388ea059801598cf7d8e4e95b1c (patch) | |
tree | 8a6f5b9230c81483405bb258ad0589bbe4cb01a2 /activerecord | |
parent | b45b96b91fc62e7488002cb05c96ec78577f7873 (diff) | |
parent | 69e0e0acf9a286a41f1adaae8e3e04b3a34101a1 (diff) | |
download | rails-f3c359800a226388ea059801598cf7d8e4e95b1c.tar.gz rails-f3c359800a226388ea059801598cf7d8e4e95b1c.tar.bz2 rails-f3c359800a226388ea059801598cf7d8e4e95b1c.zip |
Merge pull request #33906 from dark-panda/ignore-psqlrc-when-using-psql
Ignore psqlrc files when executing psql commands
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/tasks/postgresql_database_tasks.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/tasks/postgresql_rake_test.rb | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb b/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb index 533e6953a4..029f763158 100644 --- a/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb +++ b/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb @@ -61,7 +61,7 @@ module ActiveRecord ActiveRecord::Base.dump_schemas end - args = ["-s", "-x", "-O", "-f", filename] + args = ["-s", "-X", "-x", "-O", "-f", filename] args.concat(Array(extra_flags)) if extra_flags unless search_path.blank? args += search_path.split(",").map do |part| diff --git a/activerecord/test/cases/tasks/postgresql_rake_test.rb b/activerecord/test/cases/tasks/postgresql_rake_test.rb index 8c6e8d79f3..0cb90781f1 100644 --- a/activerecord/test/cases/tasks/postgresql_rake_test.rb +++ b/activerecord/test/cases/tasks/postgresql_rake_test.rb @@ -366,7 +366,7 @@ if current_adapter?(:PostgreSQLAdapter) assert_called_with( Kernel, :system, - ["pg_dump", "-s", "-x", "-O", "-f", @filename, "my-app-db"], + ["pg_dump", "-s", "-X", "-x", "-O", "-f", @filename, "my-app-db"], returns: true ) do ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename) @@ -383,7 +383,7 @@ if current_adapter?(:PostgreSQLAdapter) end def test_structure_dump_with_extra_flags - expected_command = ["pg_dump", "-s", "-x", "-O", "-f", @filename, "--noop", "my-app-db"] + expected_command = ["pg_dump", "-s", "-X", "-x", "-O", "-f", @filename, "--noop", "my-app-db"] assert_called_with(Kernel, :system, expected_command, returns: true) do with_structure_dump_flags(["--noop"]) do @@ -401,7 +401,7 @@ if current_adapter?(:PostgreSQLAdapter) assert_called_with( Kernel, :system, - ["pg_dump", "-s", "-x", "-O", "-f", @filename, "-T", "foo", "-T", "bar", "my-app-db"], + ["pg_dump", "-s", "-X", "-x", "-O", "-f", @filename, "-T", "foo", "-T", "bar", "my-app-db"], returns: true ) do ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename) @@ -415,7 +415,7 @@ if current_adapter?(:PostgreSQLAdapter) assert_called_with( Kernel, :system, - ["pg_dump", "-s", "-x", "-O", "-f", @filename, "--schema=foo", "--schema=bar", "my-app-db"], + ["pg_dump", "-s", "-X", "-x", "-O", "-f", @filename, "--schema=foo", "--schema=bar", "my-app-db"], returns: true ) do ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename) @@ -428,7 +428,7 @@ if current_adapter?(:PostgreSQLAdapter) assert_called_with( Kernel, :system, - ["pg_dump", "-s", "-x", "-O", "-f", @filename, "my-app-db"], + ["pg_dump", "-s", "-X", "-x", "-O", "-f", @filename, "my-app-db"], returns: true ) do with_dump_schemas(:all) do @@ -441,7 +441,7 @@ if current_adapter?(:PostgreSQLAdapter) assert_called_with( Kernel, :system, - ["pg_dump", "-s", "-x", "-O", "-f", @filename, "--schema=foo", "--schema=bar", "my-app-db"], + ["pg_dump", "-s", "-X", "-x", "-O", "-f", @filename, "--schema=foo", "--schema=bar", "my-app-db"], returns: true ) do with_dump_schemas("foo,bar") do @@ -455,7 +455,7 @@ if current_adapter?(:PostgreSQLAdapter) assert_called_with( Kernel, :system, - ["pg_dump", "-s", "-x", "-O", "-f", filename, "my-app-db"], + ["pg_dump", "-s", "-X", "-x", "-O", "-f", filename, "my-app-db"], returns: nil ) do e = assert_raise(RuntimeError) do |