hi there, can someone please help with a few conce...
# orm-help
y
hi there, can someone please help with a few concerns? 1. what’s the best way to track migration history? a. based on the official documentation https://www.prisma.io/docs/concepts/components/prisma-migrate#migration-history, we have list of files in
migrations
folder +
_prisma_migrations
table. it’s kind of ok for working on migrations for 1 person. but, did anyone face any problems with creating a few migrations in 10 PRs? which PR’s migration will go first when we merge? how do you handle the migration history in that case? b. how to make sure that version control work as it expected? for example when 5 engineers works on the same table and created a few PRs that will somehow affect the same table? 2. how to rollback? a. how do we rollback the latest local migration? b. how do we rollback to the specific migration? 3. how to catch migration errors? a. what happened if some migration fails? how do we know and fix it? thanks!
n
Hey 👋 1. Do you mean that all engineers are running migrations of all PRs against the same database? 2. You would need to use
npx prisma migrate diff
and
npx prisma db execute
commands to rollback a migration, here’s the official guide for it: Reference 3. Here’s a reference on how you could fix your migrations: Fixing failed migrations