docs(dev): keep new migrations convertible to Migrator

What

Adds ### Keeping migrations convertible to Migrator to docs/dev/database-migrations.md, with a pointer from ## Key rules. A new goose migration follows three rules:

  1. Write SQL, using only the goose directives the conversion maps: Up, Down, NO TRANSACTION, and StatementBegin/StatementEnd. A Go migration has no conversion path.
  2. Leave goose_db_version alone, because the switch plans to import each database's history from it (gitlab-org/theseus/migrator#3).
  3. Give a deliberate no-op Down a SELECT 1 statement beside its comment. Migrator reads a down file with no statement as irreversible.

The attach-half recipe in ### Adding indexes on populated partitioned tables previously prescribed a comment-only Down. It now writes a SELECT 1 statement.

Why

AR plans to move its migrations to Theseus Migrator (&26). These rules keep every migration merged before the switch convertible without hand edits. goose stays the tool ADR-006 section 2.1 selects until that section is amended for the switch.

A mechanical guardrail follows in #1572 (closed).

Closes #1571 (closed)

Edited by Suleimi Ahmed

Merge request reports

Loading
Loading