mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
a5d304ca51
This PR adds a db table for CR schedules. The table has two columns: 1. `change_request` :: This acts as both a foreign key and as the primary key for this table. 2. `scheduled_at` :: When the change is scheduled to be applied. We could use a separate ID column for these rows and put a `unique` constraint on the `change_request` FK, but I don't think that adds any more value. However, I'm happy to hear other thoughts around it.
23 lines
505 B
JavaScript
23 lines
505 B
JavaScript
'use strict';
|
|
|
|
exports.up = function (db, callback) {
|
|
db.runSql(
|
|
`
|
|
CREATE TABLE IF NOT EXISTS change_request_schedule (
|
|
change_request INTEGER PRIMARY KEY REFERENCES change_requests(id) ON DELETE CASCADE,
|
|
scheduled_at TIMESTAMP NOT NULL
|
|
);
|
|
`,
|
|
callback,
|
|
);
|
|
};
|
|
|
|
exports.down = function (db, callback) {
|
|
db.runSql(
|
|
`
|
|
DROP TABLE IF EXISTS change_request_schedule;
|
|
`,
|
|
callback,
|
|
);
|
|
};
|