mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-01 00:08:27 +01:00
25 lines
582 B
JavaScript
25 lines
582 B
JavaScript
|
'use strict';
|
||
|
|
||
|
exports.up = function (db, callback) {
|
||
|
db.runSql(
|
||
|
`
|
||
|
ALTER TABLE groups ADD COLUMN root_role_id INTEGER DEFAULT NULL;
|
||
|
ALTER TABLE groups
|
||
|
ADD CONSTRAINT fk_group_role_id
|
||
|
FOREIGN KEY(root_role_id)
|
||
|
REFERENCES roles(id);
|
||
|
`,
|
||
|
callback,
|
||
|
);
|
||
|
};
|
||
|
|
||
|
exports.down = function (db, callback) {
|
||
|
db.runSql(
|
||
|
`
|
||
|
ALTER TABLE groups DROP CONSTRAINT fk_group_role_id;
|
||
|
ALTER TABLE groups DROP COLUMN root_role_id;
|
||
|
`,
|
||
|
callback,
|
||
|
);
|
||
|
};
|