【发布时间】:2022-01-21 10:28:46
【问题描述】:
大家好,你能帮我解决这个问题吗,即使在运行 npx prisma generate 和 npx prisma migrate dev 之后,我也会收到一个“无法执行”的错误。如果问号“?”被删除,我尝试“迁移”我得到的错误如下:
model Creative {
id Int @id @default(autoincrement())
stock_id String @default(cuid())
parent_id String @default(cuid())
hostelMenu String?
inStock String?
}
//Error:
:warning: We found changes that cannot be executed:
• Step 0 Made the column `hostelMenu` on table `Creative` required, but there are 1 existing NULL values.
• Step 0 Made the column `inStock` on table `Creative` required, but there are 1 existing NULL values.
You can use prisma migrate dev --create-only to create the migration file, and manually modify it to address the underlying issue(s).
Then run prisma migrate dev to apply it and verify it works.
【问题讨论】: