Migration

A SQL file that changes a database's structure.

A migration is a small SQL file that changes a database's structure, such as adding a table or column.

  • They live in migrations/app.sqlite/, numbered in order: 001_events.sql, 002_add_price.sql.
  • They run on Preview's data as soon as they're added.
  • hm migrate runs them on Live, before hm publish.
  • Never edit one that's already Live. Add a new one.

See Code and data.