Development
How Strait manages immutable migrations and baseline bootstraps.
Current Policy
- Existing numbered migrations are immutable once merged.
- Never rewrite or squash already-applied migrations in deployed environments.
- Backward/forward compatibility is maintained by additive migrations.
Consolidation Plan for New Environments
To speed up fresh installs while preserving safety for existing deployments:
- Keep historical migrations (
000001..current) for upgrades. - Introduce periodic baseline snapshot migrations for fresh databases only.
- Keep incremental migrations after each baseline for active development.
Example baseline pattern:
001000_baseline_schema.up.sql— complete schema at release cut001001_*.sqlonward — normal incremental migrations
Operational Rules
- Existing environments:
- Continue applying incremental migrations in order.
- Never skip historical migration state.
- New environments:
- Bootstrap from baseline + subsequent increments.
Tooling Notes
- Baseline generation should be automated from a fully migrated reference DB.
- CI should test both paths:
- empty DB through full historical chain
- baseline through latest increments
Safety Checklist Before Releasing a Baseline
- Schema diff against reference DB is empty
- Integration/E2E pass on baseline bootstrap path
- Integration/E2E pass on historical upgrade path
- Rollback scripts verified for latest increment set
Was this page helpful?