From 5921f0ea09497a299ae9fcb671b0bd0dbeffc4dd Mon Sep 17 00:00:00 2001 From: David Leek Date: Wed, 12 Feb 2025 09:05:36 +0100 Subject: [PATCH] chore: add migration that backfills scim user email hashes (#9295) --- .../20250211114205-scim-email-hash-backfill.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/migrations/20250211114205-scim-email-hash-backfill.js diff --git a/src/migrations/20250211114205-scim-email-hash-backfill.js b/src/migrations/20250211114205-scim-email-hash-backfill.js new file mode 100644 index 0000000000..e1ae9ad0f7 --- /dev/null +++ b/src/migrations/20250211114205-scim-email-hash-backfill.js @@ -0,0 +1,14 @@ +exports.up = (db, cb) => { + db.runSql(` + UPDATE users + SET email_hash = md5(email::text) + WHERE scim_id IS NOT NULL; + `, cb); + + }; + + exports.down = (db, cb) => { + cb(); + }; + + \ No newline at end of file