Write a reversible migration and exercise the rollback
A migration with a rollback that has actually been run, not just written.
The ticket
Write a migration with a working rollback and exercise both directions in CI.
Acceptance criteria
- The migration runs forward and back against a seeded database in CI
- The rollback restores the previous schema exactly
- Data loss on rollback is stated explicitly if it is unavoidable
- Both directions are idempotent enough to re-run safely
What lands as proof
A CI run that applies and reverts the migration, which is the only way to know the rollback works.
Why teams defer it
- Rollbacks are written once and tested never, which means they fail on the day they are needed.
- Testing them needs a disposable database in CI, which is setup work before any migration is touched.
Questions
- What does the agent actually change?
- The ticket is scoped to one outcome: write a migration with a working rollback and exercise both directions in CI. Work that serves that outcome is in scope, and anything outside it is left for a separate ticket, so the pull request stays reviewable.
- How do I know the work is done?
- The pull request carries the evidence, not only the diff. Here that means up and down both run in CI against a seeded database, so a reviewer can confirm the result without reproducing the work locally.
- How much oversight does this need?
- The run stops once the plan is written. Somebody reads the approach and approves it before any code exists, which is the cheapest moment to redirect the work.