Skip to content

Commit

Permalink
fix: adding missing project column to roles
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Kolstad authored and ivarconr committed Feb 22, 2022
1 parent 951d4fc commit 615963b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/migrations/20210428103922-patch-role-table.js
Original file line number Diff line number Diff line change
@@ -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();
};

0 comments on commit 615963b

Please sign in to comment.