mirror of https://github.com/ghostfolio/ghostfolio
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.
20 lines
575 B
20 lines
575 B
2 months ago
|
-- 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;
|