// 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 = "mongodb" url = env("DATABASE_URL") //In the env file } model Blog { id Int @id @default(autoincrement()) slug String title String body String coverImage String? categoryIDs String // or Int[] depending on your use case tagIDs String // or Int[] depending on your use case createdAt DateTime @default(now()) } model Category { id String @id @default(auto()) @map("_id") @db.ObjectId name String blogIDs String[] @db.ObjectId blogs Blog[] @relation("BlogCategories", fields: [blogIDs], references: [id]) } model Tag { id String @id @default(auto()) @map("_id") @db.ObjectId name String blogIDs String[] @db.ObjectId blogs Blog[] @relation("BlogTags", fields: [blogIDs], references: [id]) } model Comment { id String @id @default(auto()) @map("_id") @db.ObjectId comment String blogId String @db.ObjectId blog Blog @relation(fields: [blogId], references: [id]) }