Interview Prep/Git & GitHub/GitHub Actions, environments and releases in production

How do you handle database migrations in a Git-based release process?

IntermediateProductionGitHub Actions, environments and releases in production
Answer

Ship migrations in the same PR but deploy them separately using expand and contract: backward-compatible schema change first, code that uses it next, cleanup migration later. Run migrations as a pipeline stage with approvals in production, never automatically at app startup on every replica.

All Git & GitHub questions Roadmap: Git & GitHub

More on GitHub Actions, environments and releases in production