mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-19 00:15:43 +01:00
feat: Add cascading delete for role_permissions when deleting a role
This commit is contained in:
parent
87268021ec
commit
979d7862db
@ -172,6 +172,12 @@ exports.up = function (db, cb) {
|
||||
'*' environment
|
||||
FROM permissions p
|
||||
WHERE p.permission = 'ADMIN';
|
||||
|
||||
ALTER TABLE role_permission
|
||||
ADD CONSTRAINT fk_role_permission
|
||||
FOREIGN KEY(role_id)
|
||||
REFERENCES roles(id) ON DELETE CASCADE;
|
||||
|
||||
`,
|
||||
cb,
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user