Migration job

A migration job is a one-shot deployment task that applies pending database schema migrations and exits after completion. In this course, a dedicated migrate container runs golang-migrate before the Go API starts, preventing the application from starting against an outdated schema.

Minimal example

yaml
migrate:
  image: migrate/migrate:v4.18.3
  command: ["-path=/migrations", "-database=mysql://app:password@tcp(mysql:3306)/zomato", "up"]
  restart: "no"

Learn this concept

Lesson 7.5 · HTTPS health and migration gates