You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.1 KiB

11 months ago
  1. -- AlterTable
  2. ALTER TABLE "users" ADD COLUMN "seen_recovery_codes" BOOLEAN DEFAULT false;
  3. -- CreateTable
  4. CREATE TABLE "recovery_codes" (
  5. "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  6. "user_id" INTEGER NOT NULL,
  7. "code_hash" TEXT NOT NULL,
  8. "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  9. CONSTRAINT "recovery_codes_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE ON UPDATE CASCADE
  10. );
  11. -- CreateTable
  12. CREATE TABLE "password_reset_tokens" (
  13. "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  14. "user_id" INTEGER NOT NULL,
  15. "token" TEXT NOT NULL,
  16. "expiresAt" DATETIME NOT NULL,
  17. "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  18. CONSTRAINT "password_reset_tokens_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE ON UPDATE CASCADE
  19. );
  20. -- CreateIndex
  21. CREATE INDEX "recovery_codes_user_id_idx" ON "recovery_codes"("user_id");
  22. -- CreateIndex
  23. CREATE UNIQUE INDEX "password_reset_tokens_token_key" ON "password_reset_tokens"("token");
  24. -- CreateIndex
  25. CREATE INDEX "password_reset_tokens_user_id_idx" ON "password_reset_tokens"("user_id");