mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-14 00:19:16 +01:00
fix: adding missing project column to roles
This commit is contained in:
parent
94426c09e5
commit
4f0bca4d19
24
src/migrations/20210428103922-patch-role-table.js
Normal file
24
src/migrations/20210428103922-patch-role-table.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const async = require('async');
|
||||||
|
|
||||||
|
function resolveRoleName(permissions) {
|
||||||
|
if (!permissions || permissions.length === 0) {
|
||||||
|
return 'Viewer';
|
||||||
|
}
|
||||||
|
if (permissions.includes('ADMIN')) {
|
||||||
|
return 'Admin';
|
||||||
|
}
|
||||||
|
return 'Editor';
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.up = function (db, cb) {
|
||||||
|
db.runSql(
|
||||||
|
'ALTER TABLE roles ADD COLUMN IF NOT EXISTS project text', cb
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.down = function (db, cb) {
|
||||||
|
// We can't just remove roles for users as we don't know if there has been any manual additions.
|
||||||
|
cb();
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user