Skip to content

feat(examples): audit & consolidate demo migration fixtures (regenerate survivors, prune redundant)#677

Merged
wmadden merged 9 commits into
mainfrom
regenerate-diamond-migration-fixture
Jun 2, 2026
Merged

feat(examples): audit & consolidate demo migration fixtures (regenerate survivors, prune redundant)#677
wmadden merged 9 commits into
mainfrom
regenerate-diamond-migration-fixture

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Audits the demo migration graph fixtures. They are manual QA scenarios (no test wires them), but 15 of 17 were topology-only (synthetic hashes, no end-contract.*) and therefore unrenderable — pointing the CLI at them threw "missing destination contract snapshot" — and most overlapped in scenario coverage now that showcase (the comprehensive fixture) and the renderer exist.

This regenerates the distinctive survivors so they actually render, and deletes the redundant ones. All regeneration is offline (prisma-next migration plan, no DB) into complete, hash-consistent fixtures, each with its own prisma-next.<name>.config.ts.

Kept + regenerated (renderable now)

  • diamond — clean divergence/convergence (regenerated first; reviewed SATISFIED).
  • wide-fan — one node -> 5 children (fan-out width).
  • converging-branches — 3 branches fan in to one node (N-way convergence).
  • skip-rollback — node-skipping rollbacks => crossing back-arcs.
  • long-spine — long vertical spine + late branch (height).
  • multi-branch — 3-way fork + 4 parallel edges (identical from->to, distinct migration hashes).

Kept as-is

  • showcase — the all-in-one (only fixture with forward cross-link, self-edge, disjoint cycle).

Deleted (10 redundant)

linear, single-branch, sub-branches, rollback, rollback-continue, multi-rollback-branch, diamond-sub-branch, complex, kitchen-sink, sequential-diamonds — each either a strict subset of a kept fixture (linear in long-spine, single-branch in multi-branch, rollback in skip-rollback) or a combination subsumed by showcase.

Test plan

  • Each regenerated survivor renders (default + --tree) via its config with no errors and the intended shape
  • prisma-next migration check passes for every survivor (each end-contract storageHash matches its migration.json to)
  • multi-branch: 4 parallel packages share from->to with distinct migrationHash, render as 4 parallel edges, no collision
  • App-space only — no extension-space packages; no synthetic-hash remnants
  • showcase, diamond, main prisma-next.config.ts, CLI/packages, and test-graphs.ts untouched
  • Reviewer (opus) verdict: SATISFIED, 7/7 ACs

Independent of the lane-colors PR (#674); branched off main. (Grew from the original diamond-only regeneration into the full fixture audit.)

@wmadden-electric wmadden-electric requested a review from a team as a code owner June 1, 2026 17:15
@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Too many files!

This PR contains 276 files, which is 126 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 5d6845af-656e-4baf-81a1-75fd9f69fbdc

📥 Commits

Reviewing files that changed from the base of the PR and between b44b4a3 and 1adc50b.

📒 Files selected for processing (276)
  • examples/prisma-next-demo/fixtures/converging-branches/contract.prisma
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260301T1000_init/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260301T1000_init/end-contract.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260301T1000_init/migration.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260301T1000_init/migration.ts
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260301T1000_init/ops.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260302T1000_add_phone/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260302T1000_add_phone/end-contract.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260302T1000_add_phone/migration.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260302T1000_add_phone/migration.ts
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260302T1000_add_phone/ops.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260302T1100_add_posts/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260302T1100_add_posts/end-contract.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260302T1100_add_posts/migration.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260302T1100_add_posts/migration.ts
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260302T1100_add_posts/ops.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260302T1200_add_avatar/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260302T1200_add_avatar/end-contract.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260302T1200_add_avatar/migration.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260302T1200_add_avatar/migration.ts
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260302T1200_add_avatar/ops.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260303T1000_merge_phone/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260303T1000_merge_phone/end-contract.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260303T1000_merge_phone/migration.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260303T1000_merge_phone/migration.ts
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260303T1000_merge_phone/ops.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260303T1100_merge_posts/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260303T1100_merge_posts/end-contract.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260303T1100_merge_posts/migration.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260303T1100_merge_posts/migration.ts
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260303T1100_merge_posts/ops.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260303T1200_merge_avatar/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260303T1200_merge_avatar/end-contract.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260303T1200_merge_avatar/migration.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260303T1200_merge_avatar/migration.ts
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/20260303T1200_merge_avatar/ops.json
  • examples/prisma-next-demo/fixtures/converging-branches/migrations/app/refs/prod.json
  • examples/prisma-next-demo/fixtures/converging-branches/prisma-next.config.ts
  • examples/prisma-next-demo/fixtures/diamond/contract.prisma
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260301T1000_init/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260301T1000_init/end-contract.json
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260301T1000_init/migration.json
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260301T1000_init/migration.ts
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260301T1000_init/ops.json
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260302T1000_alice_add_phone/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260302T1000_alice_add_phone/end-contract.json
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260302T1000_alice_add_phone/migration.json
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260302T1000_alice_add_phone/migration.ts
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260302T1000_alice_add_phone/ops.json
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260302T1100_bob_add_avatar/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260302T1100_bob_add_avatar/end-contract.json
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260302T1100_bob_add_avatar/migration.json
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260302T1100_bob_add_avatar/migration.ts
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260302T1100_bob_add_avatar/ops.json
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260303T1000_merge_alice/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260303T1000_merge_alice/end-contract.json
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260303T1000_merge_alice/migration.json
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260303T1000_merge_alice/migration.ts
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260303T1000_merge_alice/ops.json
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260303T1100_merge_bob/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260303T1100_merge_bob/end-contract.json
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260303T1100_merge_bob/migration.json
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260303T1100_merge_bob/migration.ts
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/20260303T1100_merge_bob/ops.json
  • examples/prisma-next-demo/fixtures/diamond/migrations/app/refs/prod.json
  • examples/prisma-next-demo/fixtures/diamond/prisma-next.config.ts
  • examples/prisma-next-demo/fixtures/long-spine/contract.prisma
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260301T1000_init/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260301T1000_init/end-contract.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260301T1000_init/migration.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260301T1000_init/migration.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260301T1000_init/ops.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260302T1000_add_phone/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260302T1000_add_phone/end-contract.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260302T1000_add_phone/migration.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260302T1000_add_phone/migration.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260302T1000_add_phone/ops.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260303T1000_add_bio/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260303T1000_add_bio/end-contract.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260303T1000_add_bio/migration.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260303T1000_add_bio/migration.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260303T1000_add_bio/ops.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260304T1000_add_posts/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260304T1000_add_posts/end-contract.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260304T1000_add_posts/migration.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260304T1000_add_posts/migration.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260304T1000_add_posts/ops.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260305T1000_add_avatar/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260305T1000_add_avatar/end-contract.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260305T1000_add_avatar/migration.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260305T1000_add_avatar/migration.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260305T1000_add_avatar/ops.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260306T1000_add_comments/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260306T1000_add_comments/end-contract.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260306T1000_add_comments/migration.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260306T1000_add_comments/migration.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260306T1000_add_comments/ops.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260307T1000_add_tags/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260307T1000_add_tags/end-contract.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260307T1000_add_tags/migration.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260307T1000_add_tags/migration.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260307T1000_add_tags/ops.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260307T1100_late_branch/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260307T1100_late_branch/end-contract.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260307T1100_late_branch/migration.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260307T1100_late_branch/migration.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260307T1100_late_branch/ops.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260308T1000_add_everything/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260308T1000_add_everything/end-contract.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260308T1000_add_everything/migration.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260308T1000_add_everything/migration.ts
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/20260308T1000_add_everything/ops.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/refs/prod.json
  • examples/prisma-next-demo/fixtures/long-spine/migrations/app/refs/staging.json
  • examples/prisma-next-demo/fixtures/long-spine/prisma-next.config.ts
  • examples/prisma-next-demo/fixtures/multi-branch/contract.prisma
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260301T1000_init/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260301T1000_init/end-contract.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260301T1000_init/migration.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260301T1000_init/migration.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260301T1000_init/ops.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260302T1000_add_phone/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260302T1000_add_phone/end-contract.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260302T1000_add_phone/migration.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260302T1000_add_phone/migration.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260302T1000_add_phone/ops.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260302T1100_add_posts/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260302T1100_add_posts/end-contract.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260302T1100_add_posts/migration.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260302T1100_add_posts/migration.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260302T1100_add_posts/ops.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260302T1200_add_avatar/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260302T1200_add_avatar/end-contract.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260302T1200_add_avatar/migration.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260302T1200_add_avatar/migration.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260302T1200_add_avatar/ops.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260303T1000_add_bio/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260303T1000_add_bio/end-contract.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260303T1000_add_bio/migration.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260303T1000_add_bio/migration.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260303T1000_add_bio/ops.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_a/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_a/end-contract.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_a/migration.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_a/migration.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_a/ops.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_b/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_b/end-contract.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_b/migration.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_b/migration.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_b/ops.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_c/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_c/end-contract.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_c/migration.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_c/migration.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_c/ops.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_d/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_d/end-contract.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_d/migration.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_d/migration.ts
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/20260304T1000_parallel_d/ops.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/refs/feature.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/refs/prod.json
  • examples/prisma-next-demo/fixtures/multi-branch/migrations/app/refs/staging.json
  • examples/prisma-next-demo/fixtures/multi-branch/prisma-next.config.ts
  • examples/prisma-next-demo/fixtures/showcase/contract.prisma
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0719_init/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0719_init/end-contract.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0719_init/migration.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0719_init/migration.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0719_init/ops.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0725_add_name/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0725_add_name/end-contract.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0725_add_name/migration.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0725_add_name/migration.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0725_add_name/ops.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0725_alice_phone/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0725_alice_phone/end-contract.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0725_alice_phone/migration.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0725_alice_phone/migration.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0725_alice_phone/ops.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0725_bob_avatar/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0725_bob_avatar/end-contract.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0725_bob_avatar/migration.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0725_bob_avatar/migration.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0725_bob_avatar/ops.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_add_bio/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_add_bio/end-contract.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_add_bio/migration.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_add_bio/migration.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_add_bio/ops.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_add_locale/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_add_locale/end-contract.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_add_locale/migration.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_add_locale/migration.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_add_locale/ops.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_fast_forward/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_fast_forward/end-contract.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_fast_forward/migration.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_fast_forward/migration.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_fast_forward/ops.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_merge_alice/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_merge_alice/end-contract.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_merge_alice/migration.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_merge_alice/migration.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_merge_alice/ops.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_merge_bob/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_merge_bob/end-contract.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_merge_bob/migration.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_merge_bob/migration.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0726_merge_bob/ops.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_hotfix/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_hotfix/end-contract.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_hotfix/migration.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_hotfix/migration.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_hotfix/ops.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_rollback_alice/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_rollback_alice/end-contract.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_rollback_alice/migration.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_rollback_alice/migration.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_rollback_alice/ops.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_rollback_locale/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_rollback_locale/end-contract.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_rollback_locale/migration.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_rollback_locale/migration.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_rollback_locale/ops.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_rollback_users/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_rollback_users/end-contract.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_rollback_users/migration.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_rollback_users/migration.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0727_rollback_users/ops.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0729_reapply_noop/migration.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0729_reapply_noop/ops.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0730_experiment/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0730_experiment/end-contract.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0730_experiment/migration.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0730_experiment/migration.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0730_experiment/ops.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0730_revert_experiment/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0730_revert_experiment/end-contract.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0730_revert_experiment/migration.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0730_revert_experiment/migration.ts
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/20260601T0730_revert_experiment/ops.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/refs/prod.json
  • examples/prisma-next-demo/fixtures/showcase/migrations/app/refs/staging.json
  • examples/prisma-next-demo/fixtures/showcase/prisma-next.config.ts
  • examples/prisma-next-demo/fixtures/skip-rollback/contract.prisma
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260301T1000_init/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260301T1000_init/end-contract.json
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260301T1000_init/migration.json
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260301T1000_init/migration.ts
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260301T1000_init/ops.json
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260302T1000_add_phone/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260302T1000_add_phone/end-contract.json
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260302T1000_add_phone/migration.json
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260302T1000_add_phone/migration.ts
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260302T1000_add_phone/ops.json
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260303T1000_add_bio/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260303T1000_add_bio/end-contract.json
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260303T1000_add_bio/migration.json
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260303T1000_add_bio/migration.ts
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260303T1000_add_bio/ops.json
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260304T1000_add_posts/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260304T1000_add_posts/end-contract.json
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260304T1000_add_posts/migration.json
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260304T1000_add_posts/migration.ts
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260304T1000_add_posts/ops.json
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260305T1000_rollback_to_phone/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260305T1000_rollback_to_phone/end-contract.json
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260305T1000_rollback_to_phone/migration.json
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260305T1000_rollback_to_phone/migration.ts
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260305T1000_rollback_to_phone/ops.json
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260306T1000_rollback_to_init/end-contract.d.ts
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260306T1000_rollback_to_init/end-contract.json
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260306T1000_rollback_to_init/migration.json
  • examples/prisma-next-demo/fixtures/skip-rollback/migrations/app/20260306T1000_rollback_to_init/migration.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds a comprehensive Prisma-Next demo fixture set illustrating contract evolution and parallel schema migrations. It includes five contract variants (c1–c5) with progressive field additions, initial table creation, two parallel migration branches adding phone and avatar columns, and merge operations combining those changes.

Changes

Diamond Demo Fixtures and Configuration

Layer / File(s) Summary
Contract c1: Basic user schema
examples/prisma-next-demo/diamond-contract/c1.prisma, c1.d.ts, c1.json
Initial contract defines a minimal user model with id and email fields, including generated TypeScript type definitions binding Postgres codec/query operation types and JSON contract metadata.
Contract c2: user with phone field
examples/prisma-next-demo/diamond-contract/c2.prisma, c2.d.ts, c2.json
Extends c1 by adding an optional phone field, with corresponding Prisma schema updates and regenerated contract type definitions.
Contract c3: user with avatar field
examples/prisma-next-demo/diamond-contract/c3.prisma, c3.d.ts, c3.json
Adds an optional avatar field to the schema, providing Prisma schema and generated contract type definitions for the user model with three optional fields.
Contract c5: Complete user schema
examples/prisma-next-demo/diamond-contract/c5.prisma, c5.d.ts, c5.json
Provides the full contract including all fields (id, email, phone, avatar) with complete type definitions and JSON contract specification for the final schema state.
Initial migration: create table
examples/prisma-next-demo/migration-fixtures/diamond/app/20260301T1000_init/migration.ts, migration.json, ops.json, end-contract.d.ts, end-contract.json
Defines the first migration creating the user table with id and email columns, including migration class descriptor, operation definitions, and generated end-state contract artifacts.
Alice migration: add phone column
examples/prisma-next-demo/migration-fixtures/diamond/app/20260302T1000_alice_add_phone/migration.ts, migration.json, ops.json, start-contract.d.ts, start-contract.json, end-contract.d.ts, end-contract.json
Parallel migration branch adding a nullable phone column to user, with start/end contract states and operation metadata showing schema evolution.
Bob migration: add avatar column
examples/prisma-next-demo/migration-fixtures/diamond/app/20260302T1100_bob_add_avatar/migration.ts, migration.json, ops.json, start-contract.d.ts, start-contract.json, end-contract.d.ts, end-contract.json
Parallel migration branch adding a nullable avatar column to user, with corresponding contract definitions and operation details.
Merge alice: combine phone addition
examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1000_merge_alice/migration.ts, migration.json, ops.json, start-contract.d.ts, start-contract.json, end-contract.d.ts, end-contract.json
Merge migration combining alice's phone addition, with start/end contracts showing the merged schema state.
Merge bob: combine avatar addition
examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1100_merge_bob/migration.ts, migration.json, ops.json, start-contract.d.ts, start-contract.json, end-contract.d.ts, end-contract.json
Merge migration combining bob's avatar addition, with start/end contracts reflecting the final schema state including both phone and avatar fields.
Configuration and reference updates
examples/prisma-next-demo/prisma-next.diamond.config.ts, examples/prisma-next-demo/migration-fixtures/diamond/app/refs/prod.json
Adds the Prisma-Next configuration file pointing to c5 as the contract schema and updates the production reference hash.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • prisma/prisma-next#534: The main PR regenerates prisma-next demo contract and migration fixtures to use the new per-namespace storage.namespaces.__unbound__ / target-qualified storage+FK shape introduced by the retrieved PR (changing emitted ContractBase typings and the generated contract*.json/*.d.ts/ops.json accordingly).

Suggested reviewers

  • aqrln

Poem

🐰 Through diamonds bright, a schema grows,
From Alice's branch, the phone field flows,
And Bob adds avatar, side by side,
Then merged together, unified,
A fixture dance, contracts align—
Demo perfection, by design!

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch regenerate-diamond-migration-fixture

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

size-limit report 📦

Path Size
postgres / no-emit 135.96 KB (-0.05% 🔽)
postgres / emit 108.24 KB (-0.09% 🔽)
mongo / no-emit 75.69 KB (-0.09% 🔽)
mongo / emit 70.68 KB (-0.1% 🔽)
cf-worker / no-emit 164.63 KB (-0.06% 🔽)
cf-worker / emit 133.68 KB (-0.08% 🔽)

@pkg-pr-new

pkg-pr-new Bot commented Jun 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

@prisma-next/extension-author-tools

npm i https://pkg.pr.new/@prisma-next/extension-author-tools@677

@prisma-next/mongo-runtime

npm i https://pkg.pr.new/@prisma-next/mongo-runtime@677

@prisma-next/family-mongo

npm i https://pkg.pr.new/@prisma-next/family-mongo@677

@prisma-next/sql-runtime

npm i https://pkg.pr.new/@prisma-next/sql-runtime@677

@prisma-next/family-sql

npm i https://pkg.pr.new/@prisma-next/family-sql@677

@prisma-next/extension-arktype-json

npm i https://pkg.pr.new/@prisma-next/extension-arktype-json@677

@prisma-next/middleware-cache

npm i https://pkg.pr.new/@prisma-next/middleware-cache@677

@prisma-next/mongo

npm i https://pkg.pr.new/@prisma-next/mongo@677

@prisma-next/extension-paradedb

npm i https://pkg.pr.new/@prisma-next/extension-paradedb@677

@prisma-next/extension-pgvector

npm i https://pkg.pr.new/@prisma-next/extension-pgvector@677

@prisma-next/extension-postgis

npm i https://pkg.pr.new/@prisma-next/extension-postgis@677

@prisma-next/postgres

npm i https://pkg.pr.new/@prisma-next/postgres@677

@prisma-next/sql-orm-client

npm i https://pkg.pr.new/@prisma-next/sql-orm-client@677

@prisma-next/sqlite

npm i https://pkg.pr.new/@prisma-next/sqlite@677

@prisma-next/target-mongo

npm i https://pkg.pr.new/@prisma-next/target-mongo@677

@prisma-next/adapter-mongo

npm i https://pkg.pr.new/@prisma-next/adapter-mongo@677

@prisma-next/driver-mongo

npm i https://pkg.pr.new/@prisma-next/driver-mongo@677

@prisma-next/contract

npm i https://pkg.pr.new/@prisma-next/contract@677

@prisma-next/utils

npm i https://pkg.pr.new/@prisma-next/utils@677

@prisma-next/config

npm i https://pkg.pr.new/@prisma-next/config@677

@prisma-next/errors

npm i https://pkg.pr.new/@prisma-next/errors@677

@prisma-next/framework-components

npm i https://pkg.pr.new/@prisma-next/framework-components@677

@prisma-next/operations

npm i https://pkg.pr.new/@prisma-next/operations@677

@prisma-next/ts-render

npm i https://pkg.pr.new/@prisma-next/ts-render@677

@prisma-next/contract-authoring

npm i https://pkg.pr.new/@prisma-next/contract-authoring@677

@prisma-next/ids

npm i https://pkg.pr.new/@prisma-next/ids@677

@prisma-next/psl-parser

npm i https://pkg.pr.new/@prisma-next/psl-parser@677

@prisma-next/psl-printer

npm i https://pkg.pr.new/@prisma-next/psl-printer@677

@prisma-next/cli

npm i https://pkg.pr.new/@prisma-next/cli@677

@prisma-next/cli-telemetry

npm i https://pkg.pr.new/@prisma-next/cli-telemetry@677

@prisma-next/emitter

npm i https://pkg.pr.new/@prisma-next/emitter@677

@prisma-next/migration-tools

npm i https://pkg.pr.new/@prisma-next/migration-tools@677

prisma-next

npm i https://pkg.pr.new/prisma-next@677

@prisma-next/vite-plugin-contract-emit

npm i https://pkg.pr.new/@prisma-next/vite-plugin-contract-emit@677

@prisma-next/mongo-codec

npm i https://pkg.pr.new/@prisma-next/mongo-codec@677

@prisma-next/mongo-contract

npm i https://pkg.pr.new/@prisma-next/mongo-contract@677

@prisma-next/mongo-value

npm i https://pkg.pr.new/@prisma-next/mongo-value@677

@prisma-next/mongo-contract-psl

npm i https://pkg.pr.new/@prisma-next/mongo-contract-psl@677

@prisma-next/mongo-contract-ts

npm i https://pkg.pr.new/@prisma-next/mongo-contract-ts@677

@prisma-next/mongo-emitter

npm i https://pkg.pr.new/@prisma-next/mongo-emitter@677

@prisma-next/mongo-schema-ir

npm i https://pkg.pr.new/@prisma-next/mongo-schema-ir@677

@prisma-next/mongo-query-ast

npm i https://pkg.pr.new/@prisma-next/mongo-query-ast@677

@prisma-next/mongo-orm

npm i https://pkg.pr.new/@prisma-next/mongo-orm@677

@prisma-next/mongo-query-builder

npm i https://pkg.pr.new/@prisma-next/mongo-query-builder@677

@prisma-next/mongo-lowering

npm i https://pkg.pr.new/@prisma-next/mongo-lowering@677

@prisma-next/mongo-wire

npm i https://pkg.pr.new/@prisma-next/mongo-wire@677

@prisma-next/sql-contract

npm i https://pkg.pr.new/@prisma-next/sql-contract@677

@prisma-next/sql-errors

npm i https://pkg.pr.new/@prisma-next/sql-errors@677

@prisma-next/sql-operations

npm i https://pkg.pr.new/@prisma-next/sql-operations@677

@prisma-next/sql-schema-ir

npm i https://pkg.pr.new/@prisma-next/sql-schema-ir@677

@prisma-next/sql-contract-psl

npm i https://pkg.pr.new/@prisma-next/sql-contract-psl@677

@prisma-next/sql-contract-ts

npm i https://pkg.pr.new/@prisma-next/sql-contract-ts@677

@prisma-next/sql-contract-emitter

npm i https://pkg.pr.new/@prisma-next/sql-contract-emitter@677

@prisma-next/sql-lane-query-builder

npm i https://pkg.pr.new/@prisma-next/sql-lane-query-builder@677

@prisma-next/sql-relational-core

npm i https://pkg.pr.new/@prisma-next/sql-relational-core@677

@prisma-next/sql-builder

npm i https://pkg.pr.new/@prisma-next/sql-builder@677

@prisma-next/target-postgres

npm i https://pkg.pr.new/@prisma-next/target-postgres@677

@prisma-next/target-sqlite

npm i https://pkg.pr.new/@prisma-next/target-sqlite@677

@prisma-next/adapter-postgres

npm i https://pkg.pr.new/@prisma-next/adapter-postgres@677

@prisma-next/adapter-sqlite

npm i https://pkg.pr.new/@prisma-next/adapter-sqlite@677

@prisma-next/driver-postgres

npm i https://pkg.pr.new/@prisma-next/driver-postgres@677

@prisma-next/driver-sqlite

npm i https://pkg.pr.new/@prisma-next/driver-sqlite@677

commit: 1adc50b

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1100_merge_bob/migration.ts`:
- Around line 14-19: The migration in merge_bob incorrectly adds a "phone"
column; update the addColumn call in migration.ts (the addColumn('__unbound__',
'user', {...}) invocation inside the merge_bob migration) to add Bob's "avatar"
column instead of "phone" — i.e., change the name field to 'avatar' and keep the
same typeSql/defaultSql/nullable settings (or adjust if avatar has different
constraints) so the merge_bob migration applies Bob's avatar onto Alice's branch
that already has phone.

In
`@examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1100_merge_bob/ops.json`:
- Around line 3-12: In the merge_bob migration ops.json entry, replace the
incorrect "phone" references with "avatar": update the operation "id" from
"column.user.phone" to "column.user.avatar", change the "label" from 'Add column
"phone" to "user"' to 'Add column "avatar" to "user"', and set
target.details.name to "avatar"; then update any corresponding SQL statements
(the CREATE/ALTER column references named "phone") in the migration
SQL/migration.ts that applied this op so they create/alter "avatar" instead of
"phone" (ensure the migration file for 20260303T1100_merge_bob and any function
handling this op use "column.user.avatar").

In
`@examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1100_merge_bob/start-contract.d.ts`:
- Around line 47-60: The start contract's types (FieldOutputTypes and
FieldInputTypes) currently include `avatar` and lack `phone`, which is inverted
for merge_bob; update both FieldOutputTypes.user and FieldInputTypes.user to
replace the `avatar` field with `phone` using the appropriate CodecTypes entries
(for output use CodecTypes['pg/text@1']['output'] | null and for input use
CodecTypes['pg/text@1']['input'] | null) so the contract starts from Alice's
branch (with phone) and then merge_bob can add avatar.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 9c69f723-33df-4c8e-9080-b5caa7298098

📥 Commits

Reviewing files that changed from the base of the PR and between 7ff5200 and b44b4a3.

⛔ Files ignored due to path filters (2)
  • projects/migration-graph-rendering/slices/diamond-fixture-regeneration/code-review.md is excluded by !projects/**
  • projects/migration-graph-rendering/slices/diamond-fixture-regeneration/spec.md is excluded by !projects/**
📒 Files selected for processing (47)
  • examples/prisma-next-demo/diamond-contract/c1.d.ts
  • examples/prisma-next-demo/diamond-contract/c1.json
  • examples/prisma-next-demo/diamond-contract/c1.prisma
  • examples/prisma-next-demo/diamond-contract/c2.d.ts
  • examples/prisma-next-demo/diamond-contract/c2.json
  • examples/prisma-next-demo/diamond-contract/c2.prisma
  • examples/prisma-next-demo/diamond-contract/c3.d.ts
  • examples/prisma-next-demo/diamond-contract/c3.json
  • examples/prisma-next-demo/diamond-contract/c3.prisma
  • examples/prisma-next-demo/diamond-contract/c5.d.ts
  • examples/prisma-next-demo/diamond-contract/c5.json
  • examples/prisma-next-demo/diamond-contract/c5.prisma
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260301T1000_init/end-contract.d.ts
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260301T1000_init/end-contract.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260301T1000_init/migration.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260301T1000_init/migration.ts
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260301T1000_init/ops.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260302T1000_alice_add_phone/end-contract.d.ts
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260302T1000_alice_add_phone/end-contract.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260302T1000_alice_add_phone/migration.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260302T1000_alice_add_phone/migration.ts
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260302T1000_alice_add_phone/ops.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260302T1000_alice_add_phone/start-contract.d.ts
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260302T1000_alice_add_phone/start-contract.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260302T1100_bob_add_avatar/end-contract.d.ts
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260302T1100_bob_add_avatar/end-contract.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260302T1100_bob_add_avatar/migration.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260302T1100_bob_add_avatar/migration.ts
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260302T1100_bob_add_avatar/ops.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260302T1100_bob_add_avatar/start-contract.d.ts
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260302T1100_bob_add_avatar/start-contract.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1000_merge_alice/end-contract.d.ts
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1000_merge_alice/end-contract.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1000_merge_alice/migration.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1000_merge_alice/migration.ts
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1000_merge_alice/ops.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1000_merge_alice/start-contract.d.ts
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1000_merge_alice/start-contract.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1100_merge_bob/end-contract.d.ts
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1100_merge_bob/end-contract.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1100_merge_bob/migration.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1100_merge_bob/migration.ts
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1100_merge_bob/ops.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1100_merge_bob/start-contract.d.ts
  • examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1100_merge_bob/start-contract.json
  • examples/prisma-next-demo/migration-fixtures/diamond/app/refs/prod.json
  • examples/prisma-next-demo/prisma-next.diamond.config.ts

Comment on lines +14 to +19
addColumn('__unbound__', 'user', {
name: 'phone',
typeSql: 'text',
defaultSql: '',
nullable: true,
}),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Critical: Wrong column name in merge_bob migration.

This migration adds a phone column, but merge_bob should add the avatar column (Bob's change) onto Alice's branch (which already has phone). The diamond topology requires:

  • Alice's branch (C2): has phone
  • Bob's branch (C3): has avatar
  • merge_bob: takes Alice's branch (with phone) + adds Bob's avatar
  • merge_alice: takes Bob's branch (with avatar) + adds Alice's phone
🐛 Proposed fix
     addColumn('__unbound__', 'user', {
-      name: 'phone',
+      name: 'avatar',
       typeSql: 'text',
       defaultSql: '',
       nullable: true,
     }),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1100_merge_bob/migration.ts`
around lines 14 - 19, The migration in merge_bob incorrectly adds a "phone"
column; update the addColumn call in migration.ts (the addColumn('__unbound__',
'user', {...}) invocation inside the merge_bob migration) to add Bob's "avatar"
column instead of "phone" — i.e., change the name field to 'avatar' and keep the
same typeSql/defaultSql/nullable settings (or adjust if avatar has different
constraints) so the merge_bob migration applies Bob's avatar onto Alice's branch
that already has phone.

Comment on lines 3 to +12
"id": "column.user.phone",
"label": "Add column phone to user",
"summary": "Adds column phone to table user",
"label": "Add column \"phone\" to \"user\"",
"operationClass": "additive",
"target": {
"id": "postgres",
"details": {
"schema": "public",
"objectType": "table",
"name": "user"
"schema": "__unbound__",
"objectType": "column",
"name": "phone",
"table": "user"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Critical: Wrong column name in ops.json.

Consistent with the issue in migration.ts, this operation adds phone but should add avatar. The operation ID, label, and column name must all reference avatar for the merge_bob migration.

🐛 Proposed fix
   {
-    "id": "column.user.phone",
-    "label": "Add column \"phone\" to \"user\"",
+    "id": "column.user.avatar",
+    "label": "Add column \"avatar\" to \"user\"",
     "operationClass": "additive",
     "target": {
       "id": "postgres",
       "details": {
         "schema": "__unbound__",
         "objectType": "column",
-        "name": "phone",
+        "name": "avatar",
         "table": "user"
       }
     },

And update the SQL statements:

     "precheck": [
       {
-        "description": "ensure column \"phone\" is missing",
-        "sql": "SELECT NOT EXISTS (\n  SELECT 1\n  FROM information_schema.columns\n  WHERE table_schema = current_schema()\n    AND table_name = 'user'\n    AND column_name = 'phone'\n)"
+        "description": "ensure column \"avatar\" is missing",
+        "sql": "SELECT NOT EXISTS (\n  SELECT 1\n  FROM information_schema.columns\n  WHERE table_schema = current_schema()\n    AND table_name = 'user'\n    AND column_name = 'avatar'\n)"
       }
     ],
     "execute": [
       {
-        "description": "add column \"phone\"",
-        "sql": "ALTER TABLE \"user\" ADD COLUMN \"phone\" text"
+        "description": "add column \"avatar\"",
+        "sql": "ALTER TABLE \"user\" ADD COLUMN \"avatar\" text"
       }
     ],
     "postcheck": [
       {
-        "description": "verify column \"phone\" exists",
-        "sql": "SELECT EXISTS (\n  SELECT 1\n  FROM information_schema.columns\n  WHERE table_schema = current_schema()\n    AND table_name = 'user'\n    AND column_name = 'phone'\n)"
+        "description": "verify column \"avatar\" exists",
+        "sql": "SELECT EXISTS (\n  SELECT 1\n  FROM information_schema.columns\n  WHERE table_schema = current_schema()\n    AND table_name = 'user'\n    AND column_name = 'avatar'\n)"
       }
     ]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1100_merge_bob/ops.json`
around lines 3 - 12, In the merge_bob migration ops.json entry, replace the
incorrect "phone" references with "avatar": update the operation "id" from
"column.user.phone" to "column.user.avatar", change the "label" from 'Add column
"phone" to "user"' to 'Add column "avatar" to "user"', and set
target.details.name to "avatar"; then update any corresponding SQL statements
(the CREATE/ALTER column references named "phone") in the migration
SQL/migration.ts that applied this op so they create/alter "avatar" instead of
"phone" (ensure the migration file for 20260303T1100_merge_bob and any function
handling this op use "column.user.avatar").

Comment on lines +47 to +60
export type FieldOutputTypes = {
readonly user: {
readonly id: Char<36>;
readonly email: CodecTypes['pg/text@1']['output'];
readonly avatar: CodecTypes['pg/text@1']['output'] | null;
};
};
export type FieldInputTypes = {
readonly user: {
readonly id: CodecTypes['sql/char@1']['input'];
readonly email: CodecTypes['pg/text@1']['input'];
readonly avatar: CodecTypes['pg/text@1']['input'] | null;
};
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Critical: start-contract has wrong fields for merge_bob.

The start contract includes avatar but no phone, indicating this starts from Bob's branch (C3). However, merge_bob should start from Alice's branch (C2, which has phone) and add Bob's avatar.

This confirms the entire migration is inverted:

  • Current: starts with avatar, adds phone → this is merge_alice behavior
  • Expected: starts with phone, adds avatar → correct merge_bob behavior

This start-contract should have phone instead of avatar, matching Alice's branch as the starting point.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@examples/prisma-next-demo/migration-fixtures/diamond/app/20260303T1100_merge_bob/start-contract.d.ts`
around lines 47 - 60, The start contract's types (FieldOutputTypes and
FieldInputTypes) currently include `avatar` and lack `phone`, which is inverted
for merge_bob; update both FieldOutputTypes.user and FieldInputTypes.user to
replace the `avatar` field with `phone` using the appropriate CodecTypes entries
(for output use CodecTypes['pg/text@1']['output'] | null and for input use
CodecTypes['pg/text@1']['input'] | null) so the contract starts from Alice's
branch (with phone) and then merge_bob can add avatar.

@wmadden-electric wmadden-electric changed the title feat(examples): regenerate the diamond migration fixture as a complete, renderable set feat(examples): audit & consolidate demo migration fixtures (regenerate survivors, prune redundant) Jun 2, 2026
wmadden added 9 commits June 2, 2026 14:02
The on-disk diamond fixture is topology-only with synthetic hashes, so it
can't be loaded by the live read/graph path. Spec a full offline regeneration
via `migration plan` plus a dedicated demo config.

Signed-off-by: Will Madden <madden@prisma.io>
Replace topology-only synthetic hashes with full migration packages
planned from diamond-contract sources so migration graph and check
work via prisma-next.diamond.config.ts.

Signed-off-by: Will Madden <madden@prisma.io>
Signed-off-by: Will Madden <madden@prisma.io>
Most demo migration fixtures are topology-only (unrenderable) and overlap in
scenario coverage now that showcase + the renderer exist. Spec keeps a minimal
distinctive set, regenerates the survivors offline, and deletes the rest.

Signed-off-by: Will Madden <madden@prisma.io>
Delete ten redundant topology-only fixtures and regenerate the five
survivors offline via migration plan with full contract snapshots, per-fixture
configs, and contract sources. Multi-branch parallel edges are distinct
migration packages (different migrationHash, same from/to contract).

Signed-off-by: Will Madden <madden@prisma.io>
Signed-off-by: Will Madden <madden@prisma.io>
The regenerated fixtures committed every intermediate contract state (.prisma +
emitted .json/.d.ts) plus per-node start-contract.* — all of it only needed
while planning the fixtures, not at render/check time. Keep just the one head
.prisma each config references; the graph/check pipeline emits on the fly.
Verified: all six fixtures still pass `migration check` and render unchanged.

Signed-off-by: Will Madden <madden@prisma.io>
Signed-off-by: Will Madden <madden@prisma.io>
Each demo graph fixture is now self-contained at
fixtures/<name>/ with contract.prisma, migrations/app, and a
config-relative prisma-next.config.ts. Removes scattered
migration-fixtures/, *-contract/, and per-fixture top-level configs.

Signed-off-by: Will Madden <madden@prisma.io>
@wmadden wmadden force-pushed the regenerate-diamond-migration-fixture branch from a0ecf79 to 1adc50b Compare June 2, 2026 12:02
@wmadden-electric wmadden-electric enabled auto-merge (rebase) June 2, 2026 12:04
@wmadden wmadden disabled auto-merge June 2, 2026 12:25
@wmadden wmadden merged commit f7f1ab9 into main Jun 2, 2026
21 checks passed
@wmadden wmadden deleted the regenerate-diamond-migration-fixture branch June 2, 2026 12:25
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.

2 participants