BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
89b00790
Commit
89b00790
authored
Feb 14, 2017
by
Lin Jen-Shin (godfat)
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'remove-inactive-default-email-services' into 'master'
Remove inactive default email services See merge request !8987
parents
9a0c1ffa
ca659822
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
remove-inactive-default-email-services.yml
...ogs/unreleased/remove-inactive-default-email-services.yml
+4
-0
20170206040400_remove_inactive_default_email_services.rb
.../20170206040400_remove_inactive_default_email_services.rb
+41
-0
No files found.
changelogs/unreleased/remove-inactive-default-email-services.yml
0 → 100644
View file @
89b00790
---
title
:
Remove inactive default email services
merge_request
:
8987
author
:
db/post_migrate/20170206040400_remove_inactive_default_email_services.rb
0 → 100644
View file @
89b00790
class
RemoveInactiveDefaultEmailServices
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
Gitlab
::
Database
.
with_connection_pool
(
2
)
do
|
pool
|
threads
=
[]
threads
<<
Thread
.
new
do
pool
.
with_connection
do
|
connection
|
connection
.
execute
<<-
SQL
.
strip_heredoc
DELETE FROM services
WHERE type = 'BuildsEmailService'
AND active IS FALSE
AND properties = '{"notify_only_broken_builds":true}';
SQL
end
end
threads
<<
Thread
.
new
do
pool
.
with_connection
do
|
connection
|
connection
.
execute
<<-
SQL
.
strip_heredoc
DELETE FROM services
WHERE type = 'PipelinesEmailService'
AND active IS FALSE
AND properties = '{"notify_only_broken_pipelines":true}';
SQL
end
end
threads
.
each
(
&
:join
)
end
end
def
down
# Nothing can be done to restore the records
end
end
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