chore: Add missing indexes for hooks.unfurl (#10940)

This commit is contained in:
Tom Moor
2025-12-17 17:26:29 -05:00
committed by GitHub
parent e0be5cf1d0
commit 4a59faf1a5
@@ -0,0 +1,47 @@
"use strict";
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface) {
await queryInterface.addIndex(
"integrations",
["service", "type", "createdAt"],
{
name: "integrations_service_type_createdAt",
concurrently: true,
}
);
await queryInterface.sequelize.query(`
CREATE INDEX CONCURRENTLY IF NOT EXISTS "integrations_settings_slack_gin"
ON integrations
USING gin ((settings->'slack'))
WHERE service = 'slack' AND type = 'linkedAccount';
`);
await queryInterface.addIndex(
"user_authentications",
["providerId", "createdAt"],
{
name: "user_authentications_providerId_createdAt",
concurrently: true,
}
);
},
async down(queryInterface) {
await queryInterface.removeIndex(
"integrations",
"integrations_service_type_createdAt"
);
await queryInterface.sequelize.query(`
DROP INDEX IF EXISTS "integrations_settings_slack_gin";
`);
await queryInterface.removeIndex(
"user_authentications",
"user_authentications_providerId_createdAt"
);
},
};