mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-10 01:16:39 +02:00
task: added migration for scim_external_id (#6966)
This commit is contained in:
parent
979220d80d
commit
7754ac69df
23
src/migrations/20240430075605-add-scim-external-id.js
Normal file
23
src/migrations/20240430075605-add-scim-external-id.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
exports.up = function (db, cb) {
|
||||||
|
db.runSql(
|
||||||
|
`
|
||||||
|
ALTER TABLE users ADD COLUMN scim_external_id TEXT;
|
||||||
|
ALTER TABLE groups ADD COLUMN scim_external_id TEXT;
|
||||||
|
CREATE UNIQUE INDEX users_scim_external_id_uniq_idx on users(scim_external_id) WHERE scim_external_id IS NOT NULL;
|
||||||
|
CREATE UNIQUE INDEX groups_scim_external_id_uniq_idx ON groups(scim_external_id) WHERE scim_external_id IS NOT NULL;
|
||||||
|
`,
|
||||||
|
cb,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.down = function (db, cb) {
|
||||||
|
db.runSql(
|
||||||
|
`
|
||||||
|
DROP INDEX IF EXISTS users_scim_external_id_uniq_idx;
|
||||||
|
DROP INDEX IF EXISTS groups_scim_external_id_uniq_idx;
|
||||||
|
ALTER TABLE groups DROP COLUMN scim_external_id;
|
||||||
|
ALTER TABLE users DROP COLUMN scim_external_id;
|
||||||
|
`,
|
||||||
|
cb,
|
||||||
|
);
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user