// This is your Prisma schema file, // learn more about it in the docs: https://pris.ly/d/prisma-schema // Looking for ways to speed up your queries, or scale easily with your serverless or edge functions? // Try Prisma Accelerate: https://pris.ly/cli/accelerate-init generator client { provider = "prisma-client-js" } datasource db { provider = "postgresql" url = env("DATABASE_URL") } model User { id String @id @default(cuid()) username String @unique hashed_password String likedPosts String[] sessions Session[] posts Post[] comments Comment[] } model Session { id String @id @default(cuid()) userId String expiresAt DateTime user User @relation(references: [id], fields: [userId], onDelete: Cascade) } model Post { id String @id @default(cuid()) imageUrl String caption String createdAt DateTime @default(now()) tags String[] authorId String author User @relation(references: [id], fields: [authorId], onDelete: Cascade) previewHash String comments Comment[] } model Comment { id String @id @default(cuid()) postId String authorId String content String createdAt DateTime @default(now()) upvotes Int votedBy String[] post Post @relation(references: [id], fields: [postId], onDelete: Cascade) author User @relation(references: [id], fields: [authorId], onDelete: Cascade) }