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

task: added table for requested approvers for CRs (#10159)

As part of the task to make it possible to send notifications to
approvers for a CR, this PR adds a table that can link users to CRs
they've been requested to make an approval for.
This commit is contained in:
Christopher Kolstad 2025-06-18 11:52:29 +02:00 committed by GitHub
parent 810890fe67
commit ce8d49be10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,19 @@
exports.up = function(db, cb) {
db.runSql(`CREATE TABLE change_request_requested_approvers(
change_request_id INTEGER REFERENCES change_requests(id) ON DELETE CASCADE,
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
requested_at TIMESTAMP WITH TIME ZONE DEFAULT (now() at time zone 'utc'),
PRIMARY KEY (change_request_id, user_id)
);
CREATE INDEX IF NOT EXISTS change_request_requested_approvers_cr_id_idx ON change_request_requested_approvers(change_request_id);
CREATE INDEX IF NOT EXISTS change_request_requested_approvers_user_id_idx ON change_request_requested_approvers(user_id);
`, cb)
};
exports.down = function(db, cb) {
db.runSql(`DROP TABLE IF EXISTS change_request_requested_approvers`, cb);
};
exports._meta = {
"version": 1
};