Commit 632c6a10 authored by 🤖 GitLab Bot 🤖's avatar 🤖 GitLab Bot 🤖

Automatic merge of gitlab-org/gitlab-ce master

parents ec4dca4f 892e4c0d
Pipeline #78146801 passed with stages
in 132 minutes and 33 seconds
......@@ -746,6 +746,11 @@ module Gitlab
VOLATILE
EOF
execute <<-EOF.strip_heredoc
DROP TRIGGER IF EXISTS #{trigger}
ON #{table}
EOF
execute <<-EOF.strip_heredoc
CREATE TRIGGER #{trigger}
BEFORE INSERT OR UPDATE
......
......@@ -618,11 +618,19 @@ describe Gitlab::Database::MigrationHelpers do
expect(model).to receive(:execute)
.with(/CREATE OR REPLACE FUNCTION foo()/m)
expect(model).to receive(:execute)
.with(/DROP TRIGGER IF EXISTS foo/m)
expect(model).to receive(:execute)
.with(/CREATE TRIGGER foo/m)
model.install_rename_triggers_for_postgresql('foo', :users, :old, :new)
end
it 'does not fail if trigger already exists' do
model.install_rename_triggers_for_postgresql('foo', :users, :old, :new)
model.install_rename_triggers_for_postgresql('foo', :users, :old, :new)
end
end
describe '#remove_rename_triggers_for_postgresql' do
......
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