Skip to content

Instantly share code, notes, and snippets.

@andreypopp
Created February 16, 2023 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreypopp/3f06450c185e4623bc1a85c9ec848bbf to your computer and use it in GitHub Desktop.
Save andreypopp/3f06450c185e4623bc1a85c9ec848bbf to your computer and use it in GitHub Desktop.
diff --git a/prisma/migrations/20230213210924_add_enum_statuses_to_email_verification_and_credentials_restore/migration.sql b/prisma/migrations/20230213210924_add_enum_statuses_to_email_verification_and_credentials_restore/migration.sql
index 698f38d..c3b7952 100644
--- a/prisma/migrations/20230213210924_add_enum_statuses_to_email_verification_and_credentials_restore/migration.sql
+++ b/prisma/migrations/20230213210924_add_enum_statuses_to_email_verification_and_credentials_restore/migration.sql
@@ -23,8 +23,9 @@ ALTER TABLE "EmailVerification" ADD COLUMN "triesLeft" INTEGER NOT NULL DEFAULT
ALTER TABLE "UserEmailCredentialsRestore" DROP CONSTRAINT "UserEmailCredentialsRestore_userEmailCredentialsId_fkey";
-- MANUAL MIGRATION INSTRUCTIONS
-ALTER TABLE "UserEmailCredentialsRestore" ADD COLUMN "credentialsId" TEXT NOT NULL;
+ALTER TABLE "UserEmailCredentialsRestore" ADD COLUMN "credentialsId" TEXT NULL;
UPDATE "UserEmailCredentialsRestore" SET "credentialsId" = "userEmailCredentialsId";
+ALTER TABLE "UserEmailCredentialsRestore" ALTER COLUMN "credentialsId" SET NOT NULL;
ALTER TABLE "UserEmailCredentialsRestore" DROP COLUMN "userEmailCredentialsId";
diff --git a/trpc-server/routers/credentialsRouter.ts b/trpc-server/routers/credentialsRouter.ts
index 093e50a..b7cc30f 100644
--- a/trpc-server/routers/credentialsRouter.ts
+++ b/trpc-server/routers/credentialsRouter.ts
@@ -111,7 +111,7 @@ export let credentialsRouter = router({
},
},
{
- triesLeft: 0,
+ triesLeft: 0, // lte: 0
},
],
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment