You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified that the bug I'm about to report hasn't been filed before.
What version of drizzle-orm are you using?
1.0.0-rc.1
What version of drizzle-kit are you using?
1.0.0-rc.1
Other packages
No response
Describe the Bug
I hit a similar issue to #5504 - two commutative migrations were successfully applied, but a subsequent drizzle-kit generate dropped one of the leaf's updates and created a duplicate sql migration.
Migration history:
flowchart TB
loud_piledriver["20260507223206_loud_piledriver"]
romantic_maginty["20260508222120_romantic_maginty<br/><i>ADD COLUMN stage_ids</i>"]
backfill["20260508222129_backfill_component_stage_ids<br/><i>UPDATE … SET stage_ids = ARRAY[stage_id]</i>"]
lovely_sharon["20260511173502_lovely_sharon_ventura<br/><i>ALTER TYPE integration_type ADD VALUE 'microsoft_teams'</i>"]
loud_piledriver --> romantic_maginty
romantic_maginty --> backfill
loud_piledriver --> lovely_sharon
Loading
The database state was fine: the stage_ids column was added and the enum value created.
Issue
The next drizzle-kit generate failed to reconcile the two leaves and produced a duplicate ADD COLUMN stage_ids migration. The new migration only had a single parent, rather than correctly detecting the two commutative leaves
Report hasn't been filed before.
What version of
drizzle-ormare you using?1.0.0-rc.1
What version of
drizzle-kitare you using?1.0.0-rc.1
Other packages
No response
Describe the Bug
I hit a similar issue to #5504 - two commutative migrations were successfully applied, but a subsequent
drizzle-kit generatedropped one of the leaf's updates and created a duplicate sql migration.Migration history:
flowchart TB loud_piledriver["20260507223206_loud_piledriver"] romantic_maginty["20260508222120_romantic_maginty<br/><i>ADD COLUMN stage_ids</i>"] backfill["20260508222129_backfill_component_stage_ids<br/><i>UPDATE … SET stage_ids = ARRAY[stage_id]</i>"] lovely_sharon["20260511173502_lovely_sharon_ventura<br/><i>ALTER TYPE integration_type ADD VALUE 'microsoft_teams'</i>"] loud_piledriver --> romantic_maginty romantic_maginty --> backfill loud_piledriver --> lovely_sharonThe database state was fine: the
stage_idscolumn was added and the enum value created.Issue
The next
drizzle-kit generatefailed to reconcile the two leaves and produced a duplicateADD COLUMN stage_idsmigration. The new migration only had a single parent, rather than correctly detecting the two commutative leavesflowchart TB loud_piledriver["20260507223206_loud_piledriver"] romantic_maginty["20260508222120_romantic_maginty<br/><i>ADD COLUMN stage_ids</i>"] backfill["20260508222129_backfill_component_stage_ids<br/><i>UPDATE … SET stage_ids = ARRAY[stage_id]</i>"] lovely_sharon["20260511173502_lovely_sharon_ventura<br/><i>ALTER TYPE integration_type ADD VALUE 'microsoft_teams'</i>"] mixed_amphibian["20260512013627_mixed_amphibian<br/><b>⚠ ADD COLUMN stage_ids (duplicate)</b>"] loud_piledriver --> romantic_maginty romantic_maginty --> backfill loud_piledriver --> lovely_sharon lovely_sharon --> mixed_amphibian style mixed_amphibian fill:#fee,stroke:#c00,stroke-width:2pxI resolved by manually editing the snapshot to have both
prevIdsand changing the sql to add... IF NOT EXISTSso it would no-op.Happy to provide our migration history privately