// 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()) image String? likes Int? downloads Int? instance_prompt String? isPublic Boolean @default(false) likes7d Int? @default(0) user User? @relation(fields: [userId], references: [sub]) userId String? metadata String? base_model 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? comments Comment[] } 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? gallery Gallery? @relation(fields: [galleryId], references: [id]) galleryId 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[] }