mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-11 17:20:13 +01:00
31 lines
1.1 KiB
MySQL
31 lines
1.1 KiB
MySQL
|
-- AlterTable
|
||
|
ALTER TABLE "users" ADD COLUMN "seen_recovery_codes" BOOLEAN DEFAULT false;
|
||
|
|
||
|
-- CreateTable
|
||
|
CREATE TABLE "recovery_codes" (
|
||
|
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||
|
"user_id" INTEGER NOT NULL,
|
||
|
"code_hash" TEXT NOT NULL,
|
||
|
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||
|
CONSTRAINT "recovery_codes_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE ON UPDATE CASCADE
|
||
|
);
|
||
|
|
||
|
-- CreateTable
|
||
|
CREATE TABLE "password_reset_tokens" (
|
||
|
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||
|
"user_id" INTEGER NOT NULL,
|
||
|
"token" TEXT NOT NULL,
|
||
|
"expiresAt" DATETIME NOT NULL,
|
||
|
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||
|
CONSTRAINT "password_reset_tokens_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE ON UPDATE CASCADE
|
||
|
);
|
||
|
|
||
|
-- CreateIndex
|
||
|
CREATE INDEX "recovery_codes_user_id_idx" ON "recovery_codes"("user_id");
|
||
|
|
||
|
-- CreateIndex
|
||
|
CREATE UNIQUE INDEX "password_reset_tokens_token_key" ON "password_reset_tokens"("token");
|
||
|
|
||
|
-- CreateIndex
|
||
|
CREATE INDEX "password_reset_tokens_user_id_idx" ON "password_reset_tokens"("user_id");
|