Commit 247fd024 authored by Andreas Brandl's avatar Andreas Brandl

Merge branch 'pb-drop-schema-cascade-in-drop-tables' into 'master'

Use DROP SCHEMA ... CASCADE in db:drop_tables

See merge request gitlab-org/gitlab!75937
parents a56ab410 b7d6a79a
...@@ -49,7 +49,7 @@ namespace :gitlab do ...@@ -49,7 +49,7 @@ namespace :gitlab do
# Drop all extra schema objects GitLab owns # Drop all extra schema objects GitLab owns
Gitlab::Database::EXTRA_SCHEMAS.each do |schema| Gitlab::Database::EXTRA_SCHEMAS.each do |schema|
connection.execute("DROP SCHEMA IF EXISTS #{connection.quote_table_name(schema)}") connection.execute("DROP SCHEMA IF EXISTS #{connection.quote_table_name(schema)} CASCADE")
end end
end end
......
...@@ -191,7 +191,7 @@ RSpec.describe 'gitlab:db namespace rake task', :silence_stdout do ...@@ -191,7 +191,7 @@ RSpec.describe 'gitlab:db namespace rake task', :silence_stdout do
it 'drops extra schemas' do it 'drops extra schemas' do
Gitlab::Database::EXTRA_SCHEMAS.each do |schema| Gitlab::Database::EXTRA_SCHEMAS.each do |schema|
expect(connection).to receive(:execute).with("DROP SCHEMA IF EXISTS \"#{schema}\"") expect(connection).to receive(:execute).with("DROP SCHEMA IF EXISTS \"#{schema}\" CASCADE")
end end
subject subject
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment