Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20161220101029_change_slack_service_to_slack_notification_service_in_batches.rb')
-rw-r--r--db/post_migrate/20161220101029_change_slack_service_to_slack_notification_service_in_batches.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/db/post_migrate/20161220101029_change_slack_service_to_slack_notification_service_in_batches.rb b/db/post_migrate/20161220101029_change_slack_service_to_slack_notification_service_in_batches.rb
new file mode 100644
index 00000000000..fd1405298a2
--- /dev/null
+++ b/db/post_migrate/20161220101029_change_slack_service_to_slack_notification_service_in_batches.rb
@@ -0,0 +1,17 @@
+class ChangeSlackServiceToSlackNotificationServiceInBatches < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ update_column_in_batches(:services, :type, 'SlackNotificationService') do |table, query|
+ query.where(table[:type].eq('SlackService'))
+ end
+ end
+
+ def down
+ update_column_in_batches(:services, :type, 'SlackService') do |table, query|
+ query.where(table[:type].eq('SlackNotificationService'))
+ end
+ end
+end