Parallel Branch Migrations Can Deploy Out-of-Order Causing Migration Failures
In Container Registry migrations, when two parallel branches create migrations with different timestamps, they can deploy out of chronological order across releases due to lack of visibility and coordination on what migrations are being added and when. If Migration A with a newer timestamp (e.g., `20250203120000`) merges and deploys first, followed by Migration B with an older timestamp (e.g., `20250203100000`) from an earlier branch merging later, the database's migrations table will fail to run Migration B. This occurs because the migration framework detects a newer migration already present in the schema_migrations table that doesn't exist in the database schema, causing the migration process to fail or skip Migration B entirely. The root cause is that developers working in parallel branches cannot see each other's migration timestamps until merge time, leading to chronological conflicts. **Solution:** Implement pre-merge CI validation that compares the migration timestamp of any new migration file against the latest migration timestamp in the target branch. If the new migration has an older timestamp, fail the CI check and require the developer to regenerate the migration file with a current timestamp before merging. This automated check provides the visibility and coordination currently missing from the development workflow.
issue