提交 9f4cefd2 编写于 作者: Y Yves Senn

Merge pull request #21931 from paul/bugfix/remove-deprecated-pg_dump-flag

Remove deprecated pg_dump -i flag
* No longer pass depreacted option `-i` to `pg_dump`.
*Paul Sadauskas*
* Concurrent `AR::Base#increment!` and `#decrement!` on the same record
are all reflected in the database rather than overwriting each other.
......
......@@ -54,7 +54,7 @@ def structure_dump(filename)
ActiveRecord::Base.dump_schemas
end
args = ['-i', '-s', '-x', '-O', '-f', filename]
args = ['-s', '-x', '-O', '-f', filename]
unless search_path.blank?
args << search_path.split(',').map do |part|
"--schema=#{part.strip}"
......
......@@ -204,7 +204,7 @@ def setup
end
def test_structure_dump
Kernel.expects(:system).with('pg_dump', '-i', '-s', '-x', '-O', '-f', @filename, 'my-app-db').returns(true)
Kernel.expects(:system).with('pg_dump', '-s', '-x', '-O', '-f', @filename, 'my-app-db').returns(true)
ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename)
end
......@@ -212,7 +212,7 @@ def test_structure_dump
def test_structure_dump_with_schema_search_path
@configuration['schema_search_path'] = 'foo,bar'
Kernel.expects(:system).with('pg_dump', '-i', '-s', '-x', '-O', '-f', @filename, '--schema=foo --schema=bar', 'my-app-db').returns(true)
Kernel.expects(:system).with('pg_dump', '-s', '-x', '-O', '-f', @filename, '--schema=foo --schema=bar', 'my-app-db').returns(true)
ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename)
end
......@@ -220,7 +220,7 @@ def test_structure_dump_with_schema_search_path
def test_structure_dump_with_schema_search_path_and_dump_schemas_all
@configuration['schema_search_path'] = 'foo,bar'
Kernel.expects(:system).with("pg_dump", '-i', '-s', '-x', '-O', '-f', @filename, 'my-app-db').returns(true)
Kernel.expects(:system).with("pg_dump", '-s', '-x', '-O', '-f', @filename, 'my-app-db').returns(true)
with_dump_schemas(:all) do
ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename)
......@@ -228,7 +228,7 @@ def test_structure_dump_with_schema_search_path_and_dump_schemas_all
end
def test_structure_dump_with_dump_schemas_string
Kernel.expects(:system).with("pg_dump", '-i', '-s', '-x', '-O', '-f', @filename, '--schema=foo --schema=bar', "my-app-db").returns(true)
Kernel.expects(:system).with("pg_dump", '-s', '-x', '-O', '-f', @filename, '--schema=foo --schema=bar', "my-app-db").returns(true)
with_dump_schemas('foo,bar') do
ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册