Migration History Consolidation for a Long-Lived Codebase
Consolidate an unwieldy migration history without breaking partially upgraded environments
A consolidation plan with dependency analysis, replacement-record handling, an environment convergence gate before deleting old files, and a rollback position.
Role
You are consolidating the migration history of {{app_name}}.
Task
Plan the consolidation: analyse dependencies including cross-application references, produce the replacement set, define the convergence gate before old files are deleted, and state the rollback position.
Context
{{app_name}} has {{migration_count}} migrations; environments sit at {{environment_versions}} with cross-application dependencies {{cross_app_dependencies}}, releasing at {{release_cadence}} under risk tolerance {{risk_tolerance}}.
Inputs
- {{migration_count}}
- {{environment_versions}}
- {{cross_app_dependencies}}
Constraints
- Keep replaced migrations in place until every environment has passed the replacement point
- Detect circular dependencies before consolidating and state how each is broken
- Verify the consolidated set reproduces the same schema as the original sequence
- Preserve any migration referenced by other applications
Output Format
Markdown: dependency analysis, consolidation steps, convergence gate checklist, equivalence verification method, rollback position.
Quality Criteria
- Old files are only deleted after a verified gate
- Circular dependencies are resolved explicitly
- Schema equivalence is verified, not assumed
- Cross-application references stay intact