From ea6e352a53e1379fef502e2b0efbc87bcd77a32e Mon Sep 17 00:00:00 2001 From: Christopher Kolstad Date: Tue, 5 Mar 2024 14:20:16 +0100 Subject: [PATCH] task: added scim id to user --- .../20240305131822-add-scim-id-column-to-user.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/migrations/20240305131822-add-scim-id-column-to-user.js diff --git a/src/migrations/20240305131822-add-scim-id-column-to-user.js b/src/migrations/20240305131822-add-scim-id-column-to-user.js new file mode 100644 index 000000000000..76e5229921fb --- /dev/null +++ b/src/migrations/20240305131822-add-scim-id-column-to-user.js @@ -0,0 +1,13 @@ +exports.up = function(db, cb) { + db.runSql(` + ALTER TABLE users ADD COLUMN scim_id TEXT; + CREATE INDEX users_scim_id_uniq_idx ON users (scim_id) WHERE scim_id IS NOT NULL; + `, cb); +}; + +exports.down = function(db, cb) { + db.runSql(` + DROP INDEX users_scim_id_uniq_idx; + ALTER TABLE users DROP COLUMN scim_id; + `, cb); +};