mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-15 01:14:27 -05:00
14 lines
604 B
SQL
14 lines
604 B
SQL
-- CreateTable
|
|
CREATE TABLE "ResetPasswordToken" (
|
|
"token" TEXT NOT NULL PRIMARY KEY,
|
|
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"expiresAt" DATETIME NOT NULL,
|
|
"userId" TEXT NOT NULL,
|
|
CONSTRAINT "ResetPasswordToken_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE
|
|
);
|
|
|
|
-- Disable TOTP as secret isn't encrypted anymore
|
|
UPDATE User SET totpEnabled=false, totpSecret=null, totpVerified=false WHERE totpSecret IS NOT NULL;
|
|
|
|
-- CreateIndex
|
|
CREATE UNIQUE INDEX "ResetPasswordToken_userId_key" ON "ResetPasswordToken"("userId");
|