Where should database migrations run in a pipeline?

AdvancedConceptCI/CD
Answer

As a separate, single-run step before the new app version rolls out (a Kubernetes Job or Helm pre-upgrade hook), and backward compatible with the old version through expand/contract. Don't run them in every replica's startup.

All Real-World Interview questions Roadmap: Interview readiness

More on CI/CD