lora-studio / prisma /schema.prisma
enzostvs's picture
enzostvs HF staff
wip: save image if user is logged + save in persistent storage
404baa5
raw
history blame
1.9 kB
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
model Model {
id String @id
createdAt DateTime @default(now())
title String
image String
likes Int?
downloads Int?
isPublic Boolean @default(false)
user User? @relation(fields: [userId], references: [sub])
userId String?
gallery Gallery[]
comments Comment[]
}
model Gallery {
id String @id @default(uuid())
createdAt DateTime @default(now())
prompt String
image String
isPublic Boolean @default(false)
reactions Reaction[]
model Model @relation(fields: [modelId], references: [id])
modelId String
user User? @relation(fields: [userId], references: [sub])
userId String?
}
model Reaction {
id String @id @default(uuid())
createdAt DateTime @default(now())
emoji String
user User @relation(fields: [userId], references: [sub])
gallery Gallery? @relation(fields: [galleryId], references: [id])
userId String
galleryId String?
}
model Comment {
id String @id @default(uuid())
createdAt DateTime @default(now())
text String
user User @relation(fields: [userId], references: [sub])
userId String
model Model? @relation(fields: [modelId], references: [id])
modelId String?
}
model User {
id String @id @default(uuid())
createdAt DateTime @default(now())
sub String @unique
name String
preferred_username String @unique
picture String?
comments Comment[]
reactions Reaction[]
gallery Gallery[]
models Model[]
}