Files
cloudron-box/migrations/20180429235008-fixes-scopes.js
T
Girish Ramakrishnan 97acd40829 remove obsolete roleSdk from the database
the file is renamed because cloudron.io was patched by mistake and we want to run this
migration there
2018-05-01 14:53:46 -07:00

18 lines
487 B
JavaScript

'use strict';
exports.up = function(db, callback) {
db.runSql('UPDATE clients SET scope=? WHERE id=? OR id=? OR id=?', ['*', 'cid-webadmin', 'cid-sdk', 'cid-cli'], function (error) {
if (error) console.error(error);
db.runSql('UPDATE tokens SET scope=? WHERE scope LIKE ?', ['*', '%*%'], function (error) {
if (error) console.error(error);
callback(error);
});
});
};
exports.down = function(db, callback) {
callback();
};