perf: Add userId index to oauth_authentications (#14444)

This commit is contained in:
Tom Moor authored and GitHub committed 2026-11-02 07:56:47 -05:00
1 parent 806b85e01e
commit ffdd4f9496
1 file changed
+17
@@ -0,0 +1,17 @@
"use strict";
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface) {
// Covers listing a user's authentications and cascade deletes of users.
await queryInterface.sequelize.query(
'CREATE INDEX CONCURRENTLY IF NOT EXISTS "oauth_authentications_user_id" ON "oauth_authentications" ("userId");'
);
},
async down(queryInterface) {
await queryInterface.sequelize.query(
'DROP INDEX CONCURRENTLY IF EXISTS "oauth_authentications_user_id";'
);
},
};