mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
21 lines
510 B
JavaScript
21 lines
510 B
JavaScript
|
exports.up = function (db, cb) {
|
||
|
db.runSql(
|
||
|
`
|
||
|
delete from group_role where project not in (select id from projects);
|
||
|
ALTER TABLE group_role
|
||
|
ADD CONSTRAINT fk_group_role_project
|
||
|
FOREIGN KEY(project)
|
||
|
REFERENCES projects(id) ON DELETE CASCADE; `,
|
||
|
cb,
|
||
|
);
|
||
|
};
|
||
|
|
||
|
exports.down = function (db, cb) {
|
||
|
db.runSql(
|
||
|
`
|
||
|
ALTER TABLE group_role DROP CONSTRAINT fk_group_role_project;
|
||
|
`,
|
||
|
cb,
|
||
|
);
|
||
|
};
|