summaryrefslogtreecommitdiff
path: root/db/post_migrate/20170206040400_remove_inactive_default_email_services.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20170206040400_remove_inactive_default_email_services.rb')
-rw-r--r--db/post_migrate/20170206040400_remove_inactive_default_email_services.rb41
1 files changed, 0 insertions, 41 deletions
diff --git a/db/post_migrate/20170206040400_remove_inactive_default_email_services.rb b/db/post_migrate/20170206040400_remove_inactive_default_email_services.rb
deleted file mode 100644
index f221dac8e20..00000000000
--- a/db/post_migrate/20170206040400_remove_inactive_default_email_services.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-class RemoveInactiveDefaultEmailServices < ActiveRecord::Migration[4.2]
- 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