prisma: Cannot migrate relational field from optional to required with @default(cuid())
Database: PostgreSQL (Digital Ocean)
Unable to convert an optional field to a required field:
model Dentist {
id String @default(cuid()) @id
name String
account Account?
}
migrate to
model Dentist {
id String @default(cuid()) @id
name String
account Account
}
Lift gives me the following prompt:
You are about to alter the column `account` on the `Dentist` table, which still contains 3 non-null values. The data in that column will be lost.
After confirming that this is ok (y), lift attempts to run and throws the following error:
thread 'tokio-runtime-worker-1' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:378:21
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (11 by maintainers)
This is still a problem with the latest version: