P
Prisma6mo ago
law

Database requires reset when migrating

When I make a migration, I am prompted with to reset data to complete the migration. Is there any way around this?
2 Replies
JTB
JTB6mo ago
This step is often done for data integrity. If the schema changes too much, it is sometimes not possible. I always do a backup beforehand, adjust the inserts and then simply run them through. Sometimes you can also make an adjustment to the schema so that this doesn't happen (this is only difficult if you want to have the 3rd normal form). Depending on the data, maybe work with seeds?
moosthuizen
moosthuizen6mo ago
This can happen if you update an existing model. If you are creating new fields in a model (which will cause new columns to be created), try: - Setting a default value for these columns, or - Making the value nullable @law If you can provide your schema.prisma that will help
Want results from more Discord servers?
Add your server