Skip to content

Commit 24ed528

Browse files
committed
fix(db): add index to ProjectAlertStorage to prevent sequence scans
1 parent bf736a7 commit 24ed528

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
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 "ProjectAlertStorage_alertChannelId_alertType_storageId_idx" ON "ProjectAlertStorage"("alertChannelId", "alertType", "storageId");

internal-packages/database/prisma/schema.prisma

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2198,6 +2198,8 @@ model ProjectAlertStorage {
21982198
21992199
createdAt DateTime @default(now())
22002200
updatedAt DateTime @updatedAt
2201+
2202+
@@index([alertChannelId, alertType, storageId])
22012203
}
22022204

22032205
model OrganizationIntegration {

0 commit comments

Comments
 (0)