Olhando a documentação recente do Prisma apliquei o seguinte comando para criar uma migration: npx prisma migrate dev --name init, mas o Visual Studio Code reclama da sintaxe no model Review criado na aula.
Environment variables loaded from .env Prisma schema loaded from prisma\schema.prisma Datasource "db": MySQL database "blog" at "localhost:3306"
Error: Schema parsing
error: Error validating field post
in model Review
: The relation field post
on Model Review
is missing an opposite relation field on the model Post
. Either run prisma format
or add it manually.
--> schema.prisma:34
|
33 | postId Int
34 | post Post @relation(fields: [postId], references: [id])
35 | reviewerId Int
|
error: Error validating field reviewer
in model Review
: The relation field reviewer
on Model Review
is missing an opposite relation field on the model User
. Either run prisma format
or add it manually.
--> schema.prisma:36
|
35 | reviewerId Int
36 | reviewer User @relation(fields: [reviewerId], references: [id])
37 | nota Int
|
Validation Error Count: 2