Skip to content

feat: migrations for DDL shapes that did not round-trip - #15

Merged
jasdeepkhalsa merged 1 commit into
mainfrom
feat/ddl-shapes
Oct 5, 2026
Merged

jasdeepkhalsa merged 1 commit into
mainfrom
feat/ddl-shapes

Conversation

@jasdeepkhalsa

Copy link
Copy Markdown
Member

This adds six migrations cases. Each one is a shape that DBDiff or SupaForge didn't reproduce until now:

Case What it catches
check_added_not_valid A check added NOT VALID over a row it doesn't hold for. If it were validated, as it is inside CREATE TABLE, the constraint would refuse the row it was added beside.
circular_foreign_keys Two new tables that reference each other. No creation order works with their keys inline.
subpartitioned_partition_added A partition that is partitioned in turn ("is not partitioned" otherwise).
partition_added_with_its_own_constraint_and_index A new partition's own check and index, which were lost.
exclusion_constraint_needing_an_extension btree_gist has to be installed first and dropped last. Its reverse direction also found a SupaForge --prove bug (akalforge/supaforge, fix PR open).
serial_default_dropped DROP DEFAULT leaves the sequence owned by the column, so it must stay.

Live-validated: PG15 with PGURL.

DBDiff/DBDiff#250: DBDiff's corpus passes 149/149 on PG15 (pg_dump) and PG18 (built-in renderer). SupaForge's scenarios pass 149/149 with #250 and the SupaForge prove fix.

Merge note: this appends to corpus/migrations.json, as does #14. Whichever merges second will need main merged in.

🤖 Generated with Claude Code

- check_added_not_valid: a check added NOT VALID over a row it does not
  hold for; validated, it would refuse that row.
- circular_foreign_keys: two new tables referencing each other.
- subpartitioned_partition_added: a partition partitioned in turn.
- partition_added_with_its_own_constraint_and_index.
- exclusion_constraint_needing_an_extension: btree_gist, installed first
  and dropped last.
- serial_default_dropped: the sequence stays, still owned by the column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jasdeepkhalsa
jasdeepkhalsa merged commit 26d5be7 into main Oct 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant