How can I stop data loss here?
# orm-help
v
How can I stop data loss here?
1
m
if you are using db push , use this ! https://www.prisma.io/docs/concepts/components/prisma-migrate/shadow-database or u can use prisma migrate
v
I am using prisma migrate but it asks me to reset databse
@Muhannad
I created a shadow DB loaclly as well. No data has been copied there as well
m
A migration might fail if: • You modify a migration before running it and introduce a syntax error •
You add a mandatory (NOT NULL) column to a table that already has data
• The migration process stopped unexpectedly • The database shut down in the middle of the migration process might number 2 is your issue , you need to add a default value
j
I think instead of run migration at the beginning you should run
migrate resolve --applied <YOUR MIGRATION>
instead https://www.prisma.io/docs/reference/api-reference/command-reference#examples-11
n
It seems this question is related to the other question you have asked: https://prisma.slack.com/archives/CA491RJH0/p1663741575614379