1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/src/migrations/20221114150559-change-request-comments.js
2022-11-15 09:15:56 +01:00

26 lines
655 B
JavaScript

'use strict';
exports.up = function (db, callback) {
db.runSql(
`
CREATE TABLE IF NOT EXISTS change_request_comments (
id SERIAL PRIMARY KEY,
change_request INTEGER NOT NULL REFERENCES change_requests(id) ON DELETE CASCADE,
text TEXT NOT NULL,
created_at TIMESTAMP default now(),
created_by INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE
);
`,
callback,
);
};
exports.down = function (db, callback) {
db.runSql(
`
DROP TABLE IF EXISTS change_request_comments;
`,
callback,
);
};