1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/src/migrations/20221115072335-add-required-approvals.js

26 lines
728 B
JavaScript
Raw Normal View History

'use strict';
exports.up = function (db, callback) {
db.runSql(
`
ALTER TABLE change_request_settings ADD COLUMN required_approvals integer default 1;
ALTER TABLE change_request_settings
ADD CONSTRAINT change_request_settings_project_environment_key
UNIQUE (project, environment)
`,
callback,
);
};
exports.down = function (db, callback) {
db.runSql(
`
ALTER TABLE change_request_settings DROP COLUMN IF EXISTS required_approvals;
ALTER TABLE change_request_settings
DROP CONSTRAINT IF EXISTS change_request_settings_project_environment_key;
`,
callback,
);
};