1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-26 13:48:33 +02:00

task: added notified at to change request requested approvals (#10196)

Adding this should allow us to only notify users that haven't been
notified before.

Necessary because the change_added event does not include a preData that
allowed us to diff requestedApprovers based on the event alone.

Also added a index on this column, since we're going to be using it to
filter.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Christopher Kolstad 2025-06-23 12:51:47 +02:00 committed by GitHub
parent 6871f52107
commit 6aecc3f93e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,10 @@
exports.up = function(db, cb) {
db.runSql(`ALTER TABLE change_request_requested_approvers ADD COLUMN notified_at TIMESTAMP WITH TIME ZONE;
CREATE INDEX IF NOT EXISTS cr_req_approvers_notified_at_idx ON change_request_requested_approvers(notified_at);`, cb);
};
exports.down = function(db, cb) {
db.runSql(`
DROP INDEX IF EXISTS cr_req_approvers_notified_at_idx;
ALTER TABLE change_request_requested_approvers DROP COLUMN notified_at;`, cb);
};