How can make a change to the database with Prisma.js
without having to reset the whole thing?
if I have used this command
npx prisma migrate dev --name role-makeOptional-NormalizedName
I will lose all of the data in my database but I don't lose my data.
In my case I wanted to change String
to String?
in schema.prisma
file
NormalizedName String? @unique @db.VarChar(64)
Is there a proper command to avoid losing the data?
--create-only
doesn't prevent data loss when Prisma detects a drift. It "should" (at least the name implies that it "should") prevent data loss but doesn't; in my experience it drops all tables except_prisma_migrations
and then just doesn't re-create the tables. π€ Not sure why Prisma prioritizes complete data loss. β Gleeful