Hi all,
I’m getting this error after updating schema.prisma
and running yarn rw db save
. I updated User to include posts Post[]
and Post to include user User
and @relation(fields: [userId], references: [id]) userId Int
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
posts Post[]
}
model Post {
id Int @id @default(autoincrement())
rating Int
body String
createdAt DateTime @default(now())
user User @relation(fields: [userId], references: [id])
userId Int
}
Error:
⚠️ We found migration(s) that cannot be executed:
• Added the required column `userId` to the `Post` table without a default value. There are 2 rows in this table, it is not possible to execute this migration.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Any advice on where I should be looking
Thanks,
Connor