r/Database • • 6h ago

How does your team get database migrations from a code change to production - and what still goes wrong?

Post image
0 Upvotes

I’m interested in how database migrations work in real production workflows, beyond which tool a team uses. I’d like to compare how teams handle testing, deployment, compatibility, and recovery.

For a typical application database change:

  • Where do migration scripts live, and are they handwritten, generated, or a mix?
  • When do they run: as a CI/CD job, during deployment, at application startup, or manually?
  • How are they tested before production, especially when they change or backfill existing data?
  • How do you handle old and new application versions running during the same deployment?
  • If a migration fails part-way through, how do you recover and reconcile the migration’s recorded status?

Which part causes the most trouble in your experience? If useful, mention the database, stack, and migration tool.