1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/migrations/20200429175747-users-settings.js

25 lines
588 B
JavaScript
Raw Normal View History

2020-05-12 23:05:26 +02:00
'use strict';
exports.up = function(db, callback) {
db.runSql(
`
ALTER TABLE users ADD "settings" json;
ALTER TABLE users ADD "permissions" json;
ALTER TABLE users ALTER COLUMN "permissions" SET DEFAULT '[]';
ALTER TABLE users DROP COLUMN "system_id";
`,
callback,
);
};
exports.down = function(db, callback) {
db.runSql(
`
ALTER TABLE users DROP COLUMN "settings";
ALTER TABLE users DROP COLUMN "permissions";
ALTER TABLE users ADD COLUMN "system_id" VARCHAR;
`,
callback,
);
};