1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/src/migrations/20200429175747-users-settings.js
Christopher Kolstad ff7be7696c
fix: Stores as typescript and with interfaces. (#902)
Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2021-08-12 15:04:37 +02:00

25 lines
590 B
JavaScript

'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,
);
};