Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
27 lines
825 B
SQL
27 lines
825 B
SQL
-- CreateTable
|
|
CREATE TABLE "ProWebSession" (
|
|
"id" TEXT NOT NULL,
|
|
"userId" TEXT NOT NULL,
|
|
"codeHash" TEXT,
|
|
"codeExpiresAt" TIMESTAMP(3),
|
|
"tokenHash" TEXT,
|
|
"expiresAt" TIMESTAMP(3) NOT NULL,
|
|
"lastUsedAt" TIMESTAMP(3),
|
|
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
CONSTRAINT "ProWebSession_pkey" PRIMARY KEY ("id")
|
|
);
|
|
|
|
-- CreateIndex
|
|
CREATE UNIQUE INDEX "ProWebSession_codeHash_key" ON "ProWebSession"("codeHash");
|
|
|
|
-- CreateIndex
|
|
CREATE UNIQUE INDEX "ProWebSession_tokenHash_key" ON "ProWebSession"("tokenHash");
|
|
|
|
-- CreateIndex
|
|
CREATE INDEX "ProWebSession_userId_idx" ON "ProWebSession"("userId");
|
|
|
|
-- AddForeignKey
|
|
ALTER TABLE "ProWebSession" ADD CONSTRAINT "ProWebSession_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
|