From 1bd4723237c0904ebe97a11093ef684c5b5d09ef Mon Sep 17 00:00:00 2001 From: Luke Vella Date: Tue, 5 Dec 2023 15:12:17 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20poll=20status=20not=20set?= =?UTF-8?q?=20to=20finalized=20for=20paused=20polls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 packages/database/prisma/migrations/20231205080854_fix_finalized_poll_status/migration.sql diff --git a/packages/database/prisma/migrations/20231205080854_fix_finalized_poll_status/migration.sql b/packages/database/prisma/migrations/20231205080854_fix_finalized_poll_status/migration.sql new file mode 100644 index 00000000000..66e1dc341a6 --- /dev/null +++ b/packages/database/prisma/migrations/20231205080854_fix_finalized_poll_status/migration.sql @@ -0,0 +1,8 @@ +/* + Fixes an issue in the previous migration where paused polls were not being + set to finalized if they had an event_id. +*/ +-- Set "status" to "finalized" if "event_id" is not null +UPDATE "polls" +SET "status" = 'finalized'::poll_status +WHERE "event_id" IS NOT NULL;