1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/src/migrations/20221104123349-change-request-approval.js
sjaanus 5e14e80ae3
Change request approvals table (#2347)
1. Added database table for change request approvals
2. Removed separate endpoint for applying. **Now all state changes will
go through same endpoint.**
2022-11-09 10:40:47 +02:00

25 lines
636 B
JavaScript

'use strict';
exports.up = function (db, callback) {
db.runSql(
`
CREATE TABLE IF NOT EXISTS change_request_approvals (
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()
);
`,
callback,
);
};
exports.down = function (db, callback) {
db.runSql(
`
DROP TABLE IF EXISTS change_request_approvals;
`,
callback,
);
};