Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
632c6a10
Commit
632c6a10
authored
Aug 24, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
ec4dca4f
892e4c0d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
lib/gitlab/database/migration_helpers.rb
lib/gitlab/database/migration_helpers.rb
+5
-0
spec/lib/gitlab/database/migration_helpers_spec.rb
spec/lib/gitlab/database/migration_helpers_spec.rb
+8
-0
No files found.
lib/gitlab/database/migration_helpers.rb
View file @
632c6a10
...
@@ -746,6 +746,11 @@ module Gitlab
...
@@ -746,6 +746,11 @@ module Gitlab
VOLATILE
VOLATILE
EOF
EOF
execute
<<-
EOF
.
strip_heredoc
DROP TRIGGER IF EXISTS
#{
trigger
}
ON
#{
table
}
EOF
execute
<<-
EOF
.
strip_heredoc
execute
<<-
EOF
.
strip_heredoc
CREATE TRIGGER
#{
trigger
}
CREATE TRIGGER
#{
trigger
}
BEFORE INSERT OR UPDATE
BEFORE INSERT OR UPDATE
...
...
spec/lib/gitlab/database/migration_helpers_spec.rb
View file @
632c6a10
...
@@ -618,11 +618,19 @@ describe Gitlab::Database::MigrationHelpers do
...
@@ -618,11 +618,19 @@ describe Gitlab::Database::MigrationHelpers do
expect
(
model
).
to
receive
(
:execute
)
expect
(
model
).
to
receive
(
:execute
)
.
with
(
/CREATE OR REPLACE FUNCTION foo()/m
)
.
with
(
/CREATE OR REPLACE FUNCTION foo()/m
)
expect
(
model
).
to
receive
(
:execute
)
.
with
(
/DROP TRIGGER IF EXISTS foo/m
)
expect
(
model
).
to
receive
(
:execute
)
expect
(
model
).
to
receive
(
:execute
)
.
with
(
/CREATE TRIGGER foo/m
)
.
with
(
/CREATE TRIGGER foo/m
)
model
.
install_rename_triggers_for_postgresql
(
'foo'
,
:users
,
:old
,
:new
)
model
.
install_rename_triggers_for_postgresql
(
'foo'
,
:users
,
:old
,
:new
)
end
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
end
describe
'#remove_rename_triggers_for_postgresql'
do
describe
'#remove_rename_triggers_for_postgresql'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment