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
jonfanz
jonfanz2w ago
Could you try using db pull to get your local schema in sync with your db? What does that change?
Chris Valentine
Chris ValentineOP2w ago
i can try that, though i just did that prior to updating to v6 as part of the baselining procedure
jonfanz
jonfanz2w ago
Yeah, I’m just wondering what our system thinks is different. Want to rule out any bugs on our end 🙂
Chris Valentine
Chris ValentineOP2w ago
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:
It should be understood as the set of changes to get from the expected schema to the actual schema.

[*] Changed the `_BadgeToUser` table
[+] Added primary key on columns (A, B)
)
[-] Removed unique index on columns (A, B)

[*] Changed the `_BundleToFVTTPackage` table
[+] Added primary key on columns (A, B)
)
[-] Removed unique index on columns (A, B)

[*] Changed the `_FVTTPackageToPromotion` table
[+] Added primary key on columns (A, B)
)
[-] Removed unique index on columns (A, B)

[*] Changed the `_FVTTPackageToTag` table
[+] Added primary key on columns (A, B)
)
[-] Removed unique index on columns (A, B)

[*] Changed the `_MailGroupToUser` table
[+] Added primary key on columns (A, B)
)
[-] Removed unique index on columns (A, B)

[*] Changed the `_NewsCategoryToNewsPost` table
[+] Added primary key on columns (A, B)
)
[-] Removed unique index on columns (A, B)

[*] Changed the `_NewsPostToNewsTag` table
[+] Added primary key on columns (A, B)
)
[-] Removed unique index on columns (A, B)
It should be understood as the set of changes to get from the expected schema to the actual schema.

[*] Changed the `_BadgeToUser` table
[+] Added primary key on columns (A, B)
)
[-] Removed unique index on columns (A, B)

[*] Changed the `_BundleToFVTTPackage` table
[+] Added primary key on columns (A, B)
)
[-] Removed unique index on columns (A, B)

[*] Changed the `_FVTTPackageToPromotion` table
[+] Added primary key on columns (A, B)
)
[-] Removed unique index on columns (A, B)

[*] Changed the `_FVTTPackageToTag` table
[+] Added primary key on columns (A, B)
)
[-] Removed unique index on columns (A, B)

[*] Changed the `_MailGroupToUser` table
[+] Added primary key on columns (A, B)
)
[-] Removed unique index on columns (A, B)

[*] Changed the `_NewsCategoryToNewsPost` table
[+] Added primary key on columns (A, B)
)
[-] Removed unique index on columns (A, B)

[*] Changed the `_NewsPostToNewsTag` table
[+] Added primary key on columns (A, B)
)
[-] Removed unique index on columns (A, B)
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
Chris Valentine
Chris ValentineOP2w ago
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.
No description
Chris Valentine
Chris ValentineOP2w ago
then at the end it removes all these that v5 pull had put in
No description
jonfanz
jonfanz2w ago
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?
Chris Valentine
Chris ValentineOP2w ago
yes correct, right after the part i snipped the next lines were the big in red all data lost y/N message
jonfanz
jonfanz2w ago
Cool. Let me take this back to the dev team. Definitely weird
Chris Valentine
Chris ValentineOP2w ago
Alright thanks a lot
jonfanz
jonfanz2w ago
@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
Want results from more Discord servers?
Add your server