summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-06-06 17:37:15 +0100
committerSean McGivern <sean@gitlab.com>2017-06-15 15:14:45 +0100
commitf4b5fcbca100769b89e6b06e0df180012d16a7a8 (patch)
tree7b1cb582647cbbbdabf5521e1c1055e3f89f53e4 /db/migrate
parent051b8dc4e3d055f7ac848a80d26bf1e6e0af2e24 (diff)
downloadgitlab-ce-f4b5fcbca100769b89e6b06e0df180012d16a7a8.tar.gz
Add columns for custom notification settings
Add columns for each custom notification level, defaulting to null. Read from those columns if non-null, otherwise fall back to the serialized column. Writing will write to the new column if `events` isn't manually set.
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20170606154216_add_notification_setting_columns.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/db/migrate/20170606154216_add_notification_setting_columns.rb b/db/migrate/20170606154216_add_notification_setting_columns.rb
new file mode 100644
index 00000000000..0a9b5da6583
--- /dev/null
+++ b/db/migrate/20170606154216_add_notification_setting_columns.rb
@@ -0,0 +1,26 @@
+class AddNotificationSettingColumns < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ COLUMNS = [
+ :new_note,
+ :new_issue,
+ :reopen_issue,
+ :close_issue,
+ :reassign_issue,
+ :new_merge_request,
+ :reopen_merge_request,
+ :close_merge_request,
+ :reassign_merge_request,
+ :merge_merge_request,
+ :failed_pipeline,
+ :success_pipeline
+ ]
+
+ def change
+ COLUMNS.each do |column|
+ add_column(:notification_settings, column, :boolean)
+ end
+ end
+end