1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/src/migrations/20240325081847-add-scim-id-for-groups.js
2024-03-25 11:39:11 +02:00

19 lines
364 B
JavaScript

exports.up = function (db, cb) {
db.runSql(
`
ALTER TABLE groups ADD COLUMN scim_id TEXT;
CREATE UNIQUE INDEX groups_scim_id_unique_idx ON groups(scim_id) WHERE scim_id IS NOT NULL;
`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(
`
DROP INDEX IF EXISTS groups_scim_id_unique_idx;
ALTER TABLE groups DROP COLUMN scim_id;`,
cb,
);
};