mohammed-bahumaish / prisma-editor

Prisma Editor - A powerful tool to visualize and edit Prisma Schema.
https://prisma-editor.vercel.app
854 stars 65 forks source link

getting error #72

Open arsajib33 opened 1 month ago

arsajib33 commented 1 month ago

https://prisma-editor.vercel.app/schema/10179

above code i copied from peisma website but your app is showing error

mohammed-bahumaish commented 1 month ago

i don't have access to the above shared schema, what's the error you see, and could you share a minimal schema to reproduce the error?

thanks for reporting! @arsajib33

arsajib33 commented 1 month ago

datasource db { provider = "mongodb" url = env("DATABASE_URL") }

generator client { provider = "prisma-client-js" }

model Post { id String @id @default(auto()) @map("_id") @db.ObjectId

MongoDB @default(auto()) fields must have ObjectId native type.

slug String @unique title String body String author User @relation(fields: [authorId], references: [id]) authorId String @db.ObjectId comments Comment[] }

model User { id String @id @default(auto()) @map("_id") @db.ObjectId email String @unique name String? address Address? posts Post[] }

model Comment { id String @id @default(auto()) @map("_id") @db.ObjectId comment String post Post @relation(fields: [postId], references: [id]) postId String @db.ObjectId }

// Address is an embedded document type Address { street String city String state String zip String }