Skip to content

Commit 036865f

Browse files
committed
#4090 changed migration to backfill sendslacknotifs for events based on eventtypes
1 parent 58d4877 commit 036865f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • src/backend/src/prisma/migrations/20260416232819_move_send_slack_notifs_to_event
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
-- AlterTable
22
ALTER TABLE "Event" ADD COLUMN "sendSlackNotifications" BOOLEAN NOT NULL DEFAULT false;
33

4+
-- Backfill Event.sendSlackNotifications from Event_Type before dropping the old column
5+
UPDATE "Event" e
6+
SET "sendSlackNotifications" = true
7+
FROM "Event_Type" et
8+
WHERE e."eventTypeId" = et."eventTypeId"
9+
AND et."sendSlackNotifications" = true;
10+
411
-- AlterTable
512
ALTER TABLE "Event_Type" DROP COLUMN "sendSlackNotifications";

0 commit comments

Comments
 (0)