mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-11 00:08:30 +01:00
59b8a06968
* Add constraint for project * Add constraint for project * Add constraint for project * Add constraint for project * Add constraint for project * Revert eslint * Fix eslint * Fix tests
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,
|
|
);
|
|
};
|