From c6457e75e068084feabdc6f735ad01533c59998c Mon Sep 17 00:00:00 2001 From: Catalin Pit <25515812+catalinpit@users.noreply.github.com> Date: Mon, 5 Feb 2024 05:17:01 +0200 Subject: [PATCH] feat: migration for verifying paid users (#889) --- .../20240131132916_verify_paid_users/migration.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 packages/prisma/migrations/20240131132916_verify_paid_users/migration.sql diff --git a/packages/prisma/migrations/20240131132916_verify_paid_users/migration.sql b/packages/prisma/migrations/20240131132916_verify_paid_users/migration.sql new file mode 100644 index 000000000..993f103f0 --- /dev/null +++ b/packages/prisma/migrations/20240131132916_verify_paid_users/migration.sql @@ -0,0 +1,6 @@ +UPDATE "User" +SET "emailVerified" = NOW() +FROM "Subscription" +WHERE "User"."id" = "Subscription"."userId" +AND "Subscription"."status" = 'ACTIVE' +AND "User"."emailVerified" IS NULL