diff options
author | Sean McGivern <sean@gitlab.com> | 2017-06-06 19:37:15 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-06-15 17:14:45 +0300 |
commit | f4b5fcbca100769b89e6b06e0df180012d16a7a8 (patch) | |
tree | 7b1cb582647cbbbdabf5521e1c1055e3f89f53e4 /db/migrate/20170606154216_add_notification_setting_columns.rb | |
parent | 051b8dc4e3d055f7ac848a80d26bf1e6e0af2e24 (diff) |
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/20170606154216_add_notification_setting_columns.rb')
-rw-r--r-- | db/migrate/20170606154216_add_notification_setting_columns.rb | 26 |
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 |