Skip to content

Commit 47becd4

Browse files
authored
feat: add index on channelId for SelectedCalendar (calcom#27403)
Add database index on the channelId column in the SelectedCalendar table to improve lookup performance for watched calendar channels.
1 parent 7abbc8c commit 47becd4

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- CreateIndex
2+
CREATE INDEX CONCURRENTLY IF NOT EXISTS "SelectedCalendar_channelId_idx" ON "SelectedCalendar"("channelId");

packages/prisma/schema.prisma

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,7 @@ model SelectedCalendar {
10521052
@@index([externalId])
10531053
@@index([eventTypeId])
10541054
@@index([credentialId])
1055+
@@index([channelId])
10551056
// Composite indices to optimize calendar-cache queries
10561057
@@index([integration, googleChannelExpiration, error, watchAttempts, maxAttempts], name: "SelectedCalendar_watch_idx")
10571058
@@index([integration, googleChannelExpiration, error, unwatchAttempts, maxAttempts], name: "SelectedCalendar_unwatch_idx")

0 commit comments

Comments
 (0)