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 | |
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')
-rw-r--r-- | db/migrate/20170606154216_add_notification_setting_columns.rb | 26 | ||||
-rw-r--r-- | db/schema.rb | 12 |
2 files changed, 38 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 diff --git a/db/schema.rb b/db/schema.rb index 9d79fe162b7..4e897e44f53 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -878,6 +878,18 @@ ActiveRecord::Schema.define(version: 20170606202615) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.text "events" + t.boolean "new_note" + t.boolean "new_issue" + t.boolean "reopen_issue" + t.boolean "close_issue" + t.boolean "reassign_issue" + t.boolean "new_merge_request" + t.boolean "reopen_merge_request" + t.boolean "close_merge_request" + t.boolean "reassign_merge_request" + t.boolean "merge_merge_request" + t.boolean "failed_pipeline" + t.boolean "success_pipeline" end add_index "notification_settings", ["source_id", "source_type"], name: "index_notification_settings_on_source_id_and_source_type", using: :btree |