mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-10 01:16:39 +02:00
feat: Change request rejections db table (#4486)
This commit is contained in:
parent
aafb2271be
commit
8fd5e21b4a
25
src/migrations/20230814095253-change-request-rejections.js
Normal file
25
src/migrations/20230814095253-change-request-rejections.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
exports.up = function (db, callback) {
|
||||||
|
db.runSql(
|
||||||
|
`
|
||||||
|
CREATE TABLE IF NOT EXISTS change_request_rejections (
|
||||||
|
id SERIAL PRIMARY KEY,
|
||||||
|
change_request_id INTEGER NOT NULL REFERENCES change_requests(id) ON DELETE CASCADE,
|
||||||
|
created_by INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE,
|
||||||
|
created_at TIMESTAMP DEFAULT now(),
|
||||||
|
UNIQUE (change_request_id, created_by)
|
||||||
|
);
|
||||||
|
`,
|
||||||
|
callback,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.down = function (db, callback) {
|
||||||
|
db.runSql(
|
||||||
|
`
|
||||||
|
DROP TABLE IF EXISTS change_request_rejections;
|
||||||
|
`,
|
||||||
|
callback,
|
||||||
|
);
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user