Add migration drift checks for an already-applied history
A historical migration was edited after one environment had already applied it.
- Focused work estimate
- 2h + prerequisites
- Priority in the scenario
- High
- Engineering practice
- Integrity checks · Database tooling
Estimated field mix
- Database engineering50%
- Developer tooling50%
Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.
Review it, then add it to your workspace.
The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.
Project context
A fictional subscription service has accumulated migration scripts with unclear lock risks and no consistent rehearsal output.
Setup prerequisites
- Create a disposable local database with synthetic subscriptions and a separate scratch database; author all fixtures locally.
Preceding work
Complete these dependencies, or supply their agreed outputs before taking this ticket.
- BDBMIG-101 · Add a migration inventory with checksums and sequence gaps
- BDBMIG-102 · Flag table rewrites and long-held locks for review
- BDBMIG-103 · Prevent migration commands from targeting unapproved databases
- BDBMIG-104 · Capture lock waits during a synthetic concurrent workload
- BDBMIG-105 · Test old and new application queries during expand-contract changes
- BDBMIG-106 · Resume a chunked backfill after a process interruption
- BDBMIG-107 · Distinguish reversible schema changes from irreversible data loss
- BDBMIG-108 · Produce a bounded migration review bundle
Acceptance criteria
- Compare stored applied digests to local files.
- Stop on missing or changed applied history.
- Allow only append-only new migrations.
Implementation constraints
- Do not silently repair the migration ledger.
Verification to include
- Accept appended migrations.
- Reject changed bytes in an applied migration.
Deliverables
- History drift guard.
Rollout and recovery
Fail closed on drift; document a reviewed corrective migration instead of rewriting history.
Value of the work
For the engineer: Practice migration tooling, lock reasoning, and clear developer feedback.
For the team: Provide reviewers with repeatable migration checks and explicit recovery limits.
Evidence boundaries
Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.
Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.