add priority to notification table
test plan - db migration should run fixes: KNO-362 flag=none Change-Id: I8a09c9deff8dfa904ba06ab703a2f84bfa16972e Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/231072 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Cody Cutrer <cody@instructure.com> QA-Review: Cody Cutrer <cody@instructure.com> Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
parent
5e7fa09450
commit
035a377fcb
|
@ -0,0 +1,23 @@
|
||||||
|
class AddPriorityToNotification < ActiveRecord::Migration[5.2]
|
||||||
|
tag :predeploy
|
||||||
|
|
||||||
|
PRIORITY_MESSAGE_LIST = ["Account User Registration",
|
||||||
|
"Confirm Email Communication Channel",
|
||||||
|
"Confirm Registration",
|
||||||
|
"Confirm SMS Communication Channel",
|
||||||
|
"Enrollment Invitation",
|
||||||
|
"Enrollment Notification",
|
||||||
|
"Forgot Password",
|
||||||
|
"Manually Created Access Token Created",
|
||||||
|
"Merge Email Communication Channel",
|
||||||
|
"Pseudonym Registration",
|
||||||
|
"Pseudonym Registration Done",
|
||||||
|
"Self Enrollment Registration"].freeze
|
||||||
|
|
||||||
|
# Generally we don't want to add a default to a new column, but we know this
|
||||||
|
# is a very small table and it is ok
|
||||||
|
def change
|
||||||
|
add_column :notifications, :priority, :boolean, default: false, null: false
|
||||||
|
Notification.where(name: PRIORITY_MESSAGE_LIST).update_all(priority: true) if Shard.current.default?
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue