summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2016-12-21 17:41:46 -0200
committerSean McGivern <sean@gitlab.com>2016-12-28 14:48:19 +0000
commit56465687511e19f5b7d7fe91f2bb4e2ae51de390 (patch)
tree2f7119c3b0eb7feaca22090c464e6814709c09d0 /db
parentcbee5f00fdc045eae3be2d7598e251ef4545df2f (diff)
downloadgitlab-ce-56465687511e19f5b7d7fe91f2bb4e2ae51de390.tar.gz
Revert MattermostNotificationService and SlackNotificationService to MattermostService and SlackServiceissue_25889
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20161227192806_rename_slack_and_mattermost_notification_services.rb25
-rw-r--r--db/schema.rb2
2 files changed, 26 insertions, 1 deletions
diff --git a/db/migrate/20161227192806_rename_slack_and_mattermost_notification_services.rb b/db/migrate/20161227192806_rename_slack_and_mattermost_notification_services.rb
new file mode 100644
index 00000000000..50ad7437227
--- /dev/null
+++ b/db/migrate/20161227192806_rename_slack_and_mattermost_notification_services.rb
@@ -0,0 +1,25 @@
+class RenameSlackAndMattermostNotificationServices < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ update_column_in_batches(:services, :type, 'SlackService') do |table, query|
+ query.where(table[:type].eq('SlackNotificationService'))
+ end
+
+ update_column_in_batches(:services, :type, 'MattermostService') do |table, query|
+ query.where(table[:type].eq('MattermostNotificationService'))
+ end
+ end
+
+ def down
+ update_column_in_batches(:services, :type, 'SlackNotificationService') do |table, query|
+ query.where(table[:type].eq('SlackService'))
+ end
+
+ update_column_in_batches(:services, :type, 'MattermostNotificationService') do |table, query|
+ query.where(table[:type].eq('MattermostService'))
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index e1e72bdae8f..923ece86edb 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20161226122833) do
+ActiveRecord::Schema.define(version: 20161227192806) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"