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])
|
||||
}
|
||||
|
||||
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 {
|
||||
createdAt DateTime @default(now())
|
||||
credentialId Bytes
|
||||
@ -238,6 +250,7 @@ model User {
|
||||
AccessGive Access[] @relation("accessGive")
|
||||
Account Account[]
|
||||
Analytics Analytics?
|
||||
ApiKey ApiKey[]
|
||||
AuthDevice AuthDevice[]
|
||||
Order Order[]
|
||||
Settings Settings?
|
||||
|
Loading…
x
Reference in New Issue
Block a user