mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
dc52c95787
https://linear.app/unleash/issue/2-1158/add-delete-migration-to-clean-up-no-longer-used-permissions Cleans up the filter in https://github.com/Unleash/unleash/pull/4083 and deletes the deprecated permissions from the database.
21 lines
653 B
JavaScript
21 lines
653 B
JavaScript
exports.up = function (db, cb) {
|
|
db.runSql(
|
|
`
|
|
DELETE FROM permissions WHERE permission IN ('CREATE_API_TOKEN', 'UPDATE_API_TOKEN', 'DELETE_API_TOKEN', 'READ_API_TOKEN');
|
|
DELETE FROM permissions WHERE permission = 'UPDATE_ROLE';
|
|
DELETE FROM permissions WHERE permission IN ('CREATE_ADMIN_API_TOKEN', 'UPDATE_ADMIN_API_TOKEN', 'DELETE_ADMIN_API_TOKEN', 'READ_ADMIN_API_TOKEN');
|
|
|
|
DELETE FROM role_permission rp where NOT EXISTS (SELECT * FROM permissions WHERE id = rp.permission_id);
|
|
`,
|
|
cb,
|
|
);
|
|
};
|
|
|
|
exports.down = function (db, cb) {
|
|
db.runSql(
|
|
`
|
|
`,
|
|
cb,
|
|
);
|
|
};
|