Skip to content

corpus: six migration shapes from real-world schemas - #19

Merged
jasdeepkhalsa merged 2 commits into
mainfrom
corpus/real-world-shapes
Nov 4, 2026
Merged

jasdeepkhalsa merged 2 commits into
mainfrom
corpus/real-world-shapes

Conversation

@jasdeepkhalsa

Copy link
Copy Markdown
Member

Six migration cases taken from widely used public schemas (AdventureWorks, Pagila, GitLab's structure.sql). The corpus had no case for any of them, and DBDiff got all six wrong (DBDiff/DBDiff#285):

  • array_columns_keep_their_modifiers: varchar(20)[], numeric(10,2)[], timestamptz(3)[], bit(4)[] added to a table with rows.
  • array_modifier_tightened: varchar[] becomes varchar(20)[].
  • mixed_case_domains_and_their_arrays: columns of "Name", "Flag", "Name"[] and "Mood"[].
  • domain_in_use_gains_not_valid_check: a domain in use gains a NOT VALID check that an existing row breaks.
  • partitioned_table_gains_a_column: one partition made with PARTITION OF and one attached later.
  • partitions_in_another_schema: hash partitions of a public table kept in their own schema.

npm test passes on PostgreSQL 15, 17 and 18 (43 pass, 0 fail; the one TODO is already on main).

Ordering: DBDiff and SupaForge both pin this package through their lockfiles, so nothing changes for them until they bump. Bump each one only together with a DBDiff release that includes DBDiff/DBDiff#285. Until then these cases fail its corpus job and SupaForge's scenarios.

🤖 Generated with Claude Code

jasdeepkhalsa and others added 2 commits November 3, 2026 01:12
Arrays whose element has a modifier, mixed-case domains and their arrays, a
domain in use gaining a NOT VALID check, a partitioned table gaining a
column, and partitions kept in another schema than their parent — each from
a widely used public schema, none previously in the corpus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On PostgreSQL 18 a NOT NULL is a named constraint, and a partition attached
after creation keeps its own name while one made with PARTITION OF takes the
parent's. The after side made p_2 the other way, so the case differed in a
name unrelated to the column it tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jasdeepkhalsa
jasdeepkhalsa merged commit a24962f into main Nov 4, 2026
6 checks passed
@jasdeepkhalsa
jasdeepkhalsa deleted the corpus/real-world-shapes branch November 4, 2026 23:08
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