Apply migrations exactly once during concurrent bootstrap
Two local application processes start together and both run the same migration, leaving one failed and the schema state unclear.
- Focused work estimate
- 2h 30m + prerequisites
- Priority in the scenario
- Medium
- Engineering practice
- Database migrations · Concurrency · Recovery
Estimated field mix
- DevOps60%
- Database engineering40%
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 support portal requires a database, cache, object store, and mail catcher. Setup lives in personal notes, reset scripts sometimes target shared resources, and offline work fails after package caches are cleared. Build a local-only development contract with synthetic data; no shared staging system or production credentials are supplied.
Setup prerequisites
- Environment variables
- Service health
- Database migrations
Preceding work
Complete these dependencies, or supply their agreed outputs before taking this ticket.
Acceptance criteria
- Migration ownership uses the database-supported lock
- Waiters observe the final applied version
- Failure leaves the migration retryable and visible
Implementation constraints
- Use migrations; do not replace the workflow with schema push.
Verification to include
- Start two bootstrap processes against an empty fixture database.
- Interrupt the migration owner and verify a later run can safely resolve state.
Deliverables
- Migration coordination and concurrent-start test
Rollout and recovery
Keep manual migration available until the bootstrap path is repeatable.
Value of the work
For the engineer: Practice developer-environment automation, safe reset boundaries, portability, and diagnostic quality.
For the team: Reduce onboarding and support cost while making local dependencies and destructive operations explicit.
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.