diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2016-12-29 11:44:42 +0000 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-01-05 15:51:59 -0200 |
commit | 4a0117b8b10f0dbc933d0a6655d462a07f2a5641 (patch) | |
tree | ccef498987a69df90d29094b87c449a4f8203c40 | |
parent | 0c4b34725cdee3cea844f19b6f7313db4821b7f0 (diff) | |
download | gitlab-ce-4a0117b8b10f0dbc933d0a6655d462a07f2a5641.tar.gz |
Merge branch 'issue_25889' into 'master'
Revert MattermostNotificationService and SlackNotificationService to MattermostS…
Closes #25889
See merge request !8240
-rw-r--r-- | db/migrate/20161227192806_rename_slack_and_mattermost_notification_services.rb | 25 | ||||
-rw-r--r-- | db/schema.rb | 4 |
2 files changed, 27 insertions, 2 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 eab6d7b3800..e8b79508141 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: 20161221140236) do +ActiveRecord::Schema.define(version: 20161227192806) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -1293,4 +1293,4 @@ ActiveRecord::Schema.define(version: 20161221140236) do add_foreign_key "subscriptions", "projects", on_delete: :cascade add_foreign_key "trending_projects", "projects", on_delete: :cascade add_foreign_key "u2f_registrations", "users" -end
\ No newline at end of file +end |