mirror of https://github.com/ghostfolio/ghostfolio
Thomas Kaul
2 months ago
committed by
GitHub
2 changed files with 32 additions and 0 deletions
@ -0,0 +1,19 @@ |
|||
-- CreateTable |
|||
CREATE TABLE "ApiKey" ( |
|||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|||
"hashedKey" TEXT NOT NULL, |
|||
"id" TEXT NOT NULL, |
|||
"updatedAt" TIMESTAMP(3) NOT NULL, |
|||
"userId" TEXT NOT NULL, |
|||
|
|||
CONSTRAINT "ApiKey_pkey" PRIMARY KEY ("id") |
|||
); |
|||
|
|||
-- CreateIndex |
|||
CREATE INDEX "ApiKey_hashedKey_idx" ON "ApiKey"("hashedKey"); |
|||
|
|||
-- CreateIndex |
|||
CREATE INDEX "ApiKey_userId_idx" ON "ApiKey"("userId"); |
|||
|
|||
-- AddForeignKey |
|||
ALTER TABLE "ApiKey" ADD CONSTRAINT "ApiKey_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
Loading…
Reference in new issue