diff --git a/.server-changes/project-alert-channel-id-index.md b/.server-changes/project-alert-channel-id-index.md new file mode 100644 index 0000000000..c9000c73f4 --- /dev/null +++ b/.server-changes/project-alert-channel-id-index.md @@ -0,0 +1,6 @@ +--- +area: webapp +type: improvement +--- + +Deleting an alert channel is now fast and no longer slows down as a project builds up alert history. diff --git a/internal-packages/database/prisma/migrations/20260810120000_add_project_alert_channel_id_index/migration.sql b/internal-packages/database/prisma/migrations/20260810120000_add_project_alert_channel_id_index/migration.sql new file mode 100644 index 0000000000..aada1a7ba3 --- /dev/null +++ b/internal-packages/database/prisma/migrations/20260810120000_add_project_alert_channel_id_index/migration.sql @@ -0,0 +1,2 @@ +-- CreateIndex +CREATE INDEX CONCURRENTLY IF NOT EXISTS "ProjectAlert_channelId_idx" ON "public"."ProjectAlert"("channelId"); diff --git a/internal-packages/database/prisma/schema.prisma b/internal-packages/database/prisma/schema.prisma index 545b025953..5ce51d0db4 100644 --- a/internal-packages/database/prisma/schema.prisma +++ b/internal-packages/database/prisma/schema.prisma @@ -2412,6 +2412,8 @@ model ProjectAlert { createdAt DateTime @default(now()) updatedAt DateTime @updatedAt + + @@index([channelId]) } enum ProjectAlertType {