Skip to content

Add a Core migration

  1. Add an Alembic revision under migrations/versions/ whose down_revision points to the current head. Parallel histories require an explicit merge revision.
  2. Keep the revision deterministic and forward-only. Core migrations never access internal Twenty tables.
  3. Add the domain or adapter change and a test against real PostgreSQL. Verify both empty volumes and the versioned previous schema state.
  4. drop_table, drop_column, or destructive type changes require an explicit data migration and a referenced backup/restore path.
  5. Run ./leonaid check and affected integration or feature tests. Also run ./leonaid test-upgrade when the change affects upgrades.

Alembic exit zero is necessary, but domain contracts and fresh-volume recovery provide the complete acceptance evidence.