Prisma warns of data loss when changing required field to optional, even when there is a default val
Hi there,
I currently a column with this row:
and I am trying to change it to
however, even with the default value I get an error while trying to use
db push
:
is there a way for me to just tell prisma to use false
, as I defined using @default
, since it seems quite logical to me.
---
System Information:
macOS Version: 14.4.1
Chip: Apple M2 Pro
Architecture: arm64
JavaScript/TypeScript Project Information:
Node.js Version: v20.4.0
TypeScript Version: Version 5.4.3
@prisma/client Version: 5.11.0
prisma Version: 5.11.05 Replies
bump
bump
bump
generate the migration with --create-only, edit the generated SQL file to apply false to null values, run the migration
I'm not using Prisma Migrate im using db push
Prisma is sql client and can help to create migrations but at the end you're the only one who must write it
I was able to fix the issue in the end. Thanks everyone