未验证 提交 ff1b4eb3 编写于 作者: R Ryuta Kamizono 提交者: GitHub

Merge pull request #33997 from MatthiasWinkelmann/pg_dump

Removed invalid -X flag for pg_dump, fixes #33996
...@@ -61,7 +61,7 @@ def structure_dump(filename, extra_flags) ...@@ -61,7 +61,7 @@ def structure_dump(filename, extra_flags)
ActiveRecord::Base.dump_schemas ActiveRecord::Base.dump_schemas
end end
args = ["-s", "-X", "-x", "-O", "-f", filename] args = ["-s", "-x", "-O", "-f", filename]
args.concat(Array(extra_flags)) if extra_flags args.concat(Array(extra_flags)) if extra_flags
unless search_path.blank? unless search_path.blank?
args += search_path.split(",").map do |part| args += search_path.split(",").map do |part|
......
...@@ -366,7 +366,7 @@ def test_structure_dump ...@@ -366,7 +366,7 @@ def test_structure_dump
assert_called_with( assert_called_with(
Kernel, Kernel,
:system, :system,
["pg_dump", "-s", "-X", "-x", "-O", "-f", @filename, "my-app-db"], ["pg_dump", "-s", "-x", "-O", "-f", @filename, "my-app-db"],
returns: true returns: true
) do ) do
ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename) ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename)
...@@ -383,7 +383,7 @@ def test_structure_dump_header_comments_removed ...@@ -383,7 +383,7 @@ def test_structure_dump_header_comments_removed
end end
def test_structure_dump_with_extra_flags def test_structure_dump_with_extra_flags
expected_command = ["pg_dump", "-s", "-X", "-x", "-O", "-f", @filename, "--noop", "my-app-db"] expected_command = ["pg_dump", "-s", "-x", "-O", "-f", @filename, "--noop", "my-app-db"]
assert_called_with(Kernel, :system, expected_command, returns: true) do assert_called_with(Kernel, :system, expected_command, returns: true) do
with_structure_dump_flags(["--noop"]) do with_structure_dump_flags(["--noop"]) do
...@@ -401,7 +401,7 @@ def test_structure_dump_with_ignore_tables ...@@ -401,7 +401,7 @@ def test_structure_dump_with_ignore_tables
assert_called_with( assert_called_with(
Kernel, Kernel,
:system, :system,
["pg_dump", "-s", "-X", "-x", "-O", "-f", @filename, "-T", "foo", "-T", "bar", "my-app-db"], ["pg_dump", "-s", "-x", "-O", "-f", @filename, "-T", "foo", "-T", "bar", "my-app-db"],
returns: true returns: true
) do ) do
ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename) ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename)
...@@ -415,7 +415,7 @@ def test_structure_dump_with_schema_search_path ...@@ -415,7 +415,7 @@ def test_structure_dump_with_schema_search_path
assert_called_with( assert_called_with(
Kernel, Kernel,
:system, :system,
["pg_dump", "-s", "-X", "-x", "-O", "-f", @filename, "--schema=foo", "--schema=bar", "my-app-db"], ["pg_dump", "-s", "-x", "-O", "-f", @filename, "--schema=foo", "--schema=bar", "my-app-db"],
returns: true returns: true
) do ) do
ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename) ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename)
...@@ -428,7 +428,7 @@ def test_structure_dump_with_schema_search_path_and_dump_schemas_all ...@@ -428,7 +428,7 @@ def test_structure_dump_with_schema_search_path_and_dump_schemas_all
assert_called_with( assert_called_with(
Kernel, Kernel,
:system, :system,
["pg_dump", "-s", "-X", "-x", "-O", "-f", @filename, "my-app-db"], ["pg_dump", "-s", "-x", "-O", "-f", @filename, "my-app-db"],
returns: true returns: true
) do ) do
with_dump_schemas(:all) do with_dump_schemas(:all) do
...@@ -441,7 +441,7 @@ def test_structure_dump_with_dump_schemas_string ...@@ -441,7 +441,7 @@ def test_structure_dump_with_dump_schemas_string
assert_called_with( assert_called_with(
Kernel, Kernel,
:system, :system,
["pg_dump", "-s", "-X", "-x", "-O", "-f", @filename, "--schema=foo", "--schema=bar", "my-app-db"], ["pg_dump", "-s", "-x", "-O", "-f", @filename, "--schema=foo", "--schema=bar", "my-app-db"],
returns: true returns: true
) do ) do
with_dump_schemas("foo,bar") do with_dump_schemas("foo,bar") do
...@@ -455,7 +455,7 @@ def test_structure_dump_execution_fails ...@@ -455,7 +455,7 @@ def test_structure_dump_execution_fails
assert_called_with( assert_called_with(
Kernel, Kernel,
:system, :system,
["pg_dump", "-s", "-X", "-x", "-O", "-f", filename, "my-app-db"], ["pg_dump", "-s", "-x", "-O", "-f", filename, "my-app-db"],
returns: nil returns: nil
) do ) do
e = assert_raise(RuntimeError) do e = assert_raise(RuntimeError) do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册