intermediate

Migrations

Generate and review SQL migrations so type-safe schema code does not replace deployment discipline.

Drizzle Kit generates SQL migrations from schema changes or supports SQL-first workflows. The habit that matters: review what will run and keep schema code, migration files, and deployed databases synchronized.

On interviews: generated migration review, environments, rollback expectations, schema drift, when hand-written SQL is appropriate.

Common pitfalls: type-safe schema edits mistaken for safe production DDL; large index builds and column rewrites without rollout planning.

The trade-off is codegen speed versus operational DDL discipline.

Checklist:

  • Review generated files.
  • Plan production DDL impact.
  • Keep schema and migration history together.
  • Test apply order on staging data.