v6 Migration Doesn't Work
I did a baseline for my current db in prisma 5. all in sync, all good.
I think updated prisma and @prisma/client to v6
then i ran
npx prisma migrate dev --name upgrade-to-v6
and it says my database is out of sync with my schema and it has shifted. it lists all the things that are wrong with it
That list of wrong issues only contains the implicit index changes from v6.
It then says in order to run this i must lose all data??? has to be a way to do this without losing all data?
as a note my usual method of adding to adn removing from the database are:
npx prisma generate
npx prisma push
12 Replies
Could you try using
db pull
to get your local schema in sync with your db? What does that change?i can try that, though i just did that prior to updating to v6 as part of the baselining procedure
Yeah, I’m just wondering what our system thinks is different. Want to rule out any bugs on our end 🙂
This will take some time to sort. my normal schema is not alphabetically sorted and contains tons of comments and spacing differences.
The pull includes none of that so knowing what is different is... difficult
this is the return from when i tried to run the v6 migration though:
which is my guess what it will say
ok i just renamed my remarked one, then did a pull in v5 and left it unaltered
updated to v6 did another pull
diffed the two
a bunch of changes like this, where v5 pull gavea this one name and a different type. and then v6 gives it a differet name adn a different type.
then at the end it removes all these that v5 pull had put in
Yeah, not sure why that is. I’m going to have to bring this to our dev team, so unfortunately can’t give you an answer right away.
But the original migration looks correct. That’s giving you the dreaded “reset db” message?
yes correct, right after the part i snipped the next lines were the big in red all data lost y/N message
Cool. Let me take this back to the dev team. Definitely weird
Alright thanks a lot
@Chris Valentine thanks for your patience. Do you think you could share your schema? By DM is fine is you’d prefer. We’d like to reproduce this