feat: add index on channelId for SelectedCalendar (#27403)

Add database index on the channelId column in the SelectedCalendar
table to improve lookup performance for watched calendar channels.
This commit is contained in:
Volnei Munhoz
2026-01-29 20:36:40 +00:00
committed by GitHub
parent 7abbc8c22c
commit 47becd416d
2 changed files with 3 additions and 0 deletions
@@ -0,0 +1,2 @@
-- CreateIndex
CREATE INDEX CONCURRENTLY IF NOT EXISTS "SelectedCalendar_channelId_idx" ON "SelectedCalendar"("channelId");
+1
View File
@@ -1052,6 +1052,7 @@ model SelectedCalendar {
@@index([externalId])
@@index([eventTypeId])
@@index([credentialId])
@@index([channelId])
// Composite indices to optimize calendar-cache queries
@@index([integration, googleChannelExpiration, error, watchAttempts, maxAttempts], name: "SelectedCalendar_watch_idx")
@@index([integration, googleChannelExpiration, error, unwatchAttempts, maxAttempts], name: "SelectedCalendar_unwatch_idx")