Feature/setup api keys for Ghostfolio data provider (#4088)
* Setup API keys for Ghostfolio data provider
This commit is contained in:
parent
ea24a618b0
commit
9461b32a39
@ -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;
|
@ -77,6 +77,18 @@ model Analytics {
|
|||||||
@@index([updatedAt])
|
@@index([updatedAt])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model ApiKey {
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
hashedKey String
|
||||||
|
id String @id @default(uuid())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
userId String
|
||||||
|
user User @relation(fields: [userId], onDelete: Cascade, references: [id])
|
||||||
|
|
||||||
|
@@index([hashedKey])
|
||||||
|
@@index([userId])
|
||||||
|
}
|
||||||
|
|
||||||
model AuthDevice {
|
model AuthDevice {
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
credentialId Bytes
|
credentialId Bytes
|
||||||
@ -238,6 +250,7 @@ model User {
|
|||||||
AccessGive Access[] @relation("accessGive")
|
AccessGive Access[] @relation("accessGive")
|
||||||
Account Account[]
|
Account Account[]
|
||||||
Analytics Analytics?
|
Analytics Analytics?
|
||||||
|
ApiKey ApiKey[]
|
||||||
AuthDevice AuthDevice[]
|
AuthDevice AuthDevice[]
|
||||||
Order Order[]
|
Order Order[]
|
||||||
Settings Settings?
|
Settings Settings?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user