fix: migrate better auth 2fa schema

This commit is contained in:
Amruth Pillai
2026-07-05 00:05:53 +02:00
parent 8416a92153
commit 9f9268f380
3 changed files with 5122 additions and 0 deletions
@@ -0,0 +1,2 @@
ALTER TABLE "two_factor" ADD COLUMN "failed_verification_count" integer DEFAULT 0;--> statement-breakpoint
ALTER TABLE "two_factor" ADD COLUMN "locked_until" timestamp with time zone;
File diff suppressed because it is too large Load Diff
+2
View File
@@ -139,6 +139,8 @@ export const twoFactor = pg.pgTable(
secret: pg.text("secret").notNull(),
backupCodes: pg.text("backup_codes").notNull(),
verified: pg.boolean("verified").notNull().default(true),
failedVerificationCount: pg.integer("failed_verification_count").default(0),
lockedUntil: pg.timestamp("locked_until", { withTimezone: true }),
createdAt: pg.timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
updatedAt: pg
.timestamp("updated_at", { withTimezone: true })