Merge pull request #284 from BTLzdravtech/dev

feat: Basic support for Keycloak (OIDC) + fix s3 integration + custom s3 (minio) support
This commit is contained in:
Daniel
2023-11-19 16:55:09 +03:30
committed by GitHub
14 changed files with 132 additions and 17 deletions
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "User" ALTER COLUMN "password" DROP NOT NULL;
@@ -0,0 +1,23 @@
-- CreateTable
CREATE TABLE "Account" (
"id" TEXT NOT NULL,
"userId" INTEGER NOT NULL,
"type" TEXT NOT NULL,
"provider" TEXT NOT NULL,
"providerAccountId" TEXT NOT NULL,
"refresh_token" TEXT,
"access_token" TEXT,
"expires_at" INTEGER,
"token_type" TEXT,
"scope" TEXT,
"id_token" TEXT,
"session_state" TEXT,
CONSTRAINT "Account_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "Account_provider_providerAccountId_key" ON "Account"("provider", "providerAccountId");
-- AddForeignKey
ALTER TABLE "Account" ADD CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
+27 -6
View File
@@ -7,6 +7,25 @@ datasource db {
url = env("DATABASE_URL")
}
model Account {
id String @id @default(cuid())
userId Int
type String
provider String
providerAccountId String
refresh_token String?
access_token String?
expires_at Int?
token_type String?
scope String?
id_token String?
session_state String?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([provider, providerAccountId])
}
model User {
id Int @id @default(autoincrement())
name String
@@ -17,7 +36,9 @@ model User {
emailVerified DateTime?
image String?
password String
accounts Account[]
password String?
collections Collection[]
tags Tag[]
@@ -101,13 +122,13 @@ model Link {
name String
url String
description String @default("")
pinnedBy User[]
collection Collection @relation(fields: [collectionId], references: [id])
collectionId Int
tags Tag[]
textContent String?
screenshotPath String?
@@ -115,7 +136,7 @@ model Link {
readabilityPath String?
lastPreserved DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt @default(now())
}
@@ -135,7 +156,7 @@ model Tag {
model Subscription {
id Int @id @default(autoincrement())
active Boolean
active Boolean
stripeSubscriptionId String @unique
currentPeriodStart DateTime
currentPeriodEnd DateTime