2020-05-12 23:05:26 +02:00
|
|
|
'use strict';
|
|
|
|
|
2021-08-12 15:04:37 +02:00
|
|
|
exports.up = function (db, callback) {
|
2020-05-12 23:05:26 +02:00
|
|
|
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,
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2021-08-12 15:04:37 +02:00
|
|
|
exports.down = function (db, callback) {
|
2020-05-12 23:05:26 +02:00
|
|
|
db.runSql(
|
|
|
|
`
|
|
|
|
ALTER TABLE users DROP COLUMN "settings";
|
|
|
|
ALTER TABLE users DROP COLUMN "permissions";
|
|
|
|
ALTER TABLE users ADD COLUMN "system_id" VARCHAR;
|
|
|
|
`,
|
|
|
|
callback,
|
|
|
|
);
|
|
|
|
};
|