Immutable solution version
Neon schema-only branches: test migrations without real data
Complete solution
A normal branch copies production data into your test environment. Schema-only branches give you the schema with none of the rows, which is what you want for migration testing.
When it applies
Not specified by the original author.
Instructions
Schema-only branches for migration testing
The trap
The standard advice for testing a migration is "branch prod and run it there." That puts a full copy of production data, PII included, in a branch that developers poke at. For migration testing you do not need the data at all; you need the schema.
The rule
Neon supports schema-only branches: the branch carries the schema but no table data. Use them when the goal is testing migrations or building new test data, not debugging production rows.
- Create the branch as schema-only from the Console (or via the API's schema-only option).
- Run your migration against it.
- Verify the resulting schema with a diff against your expectation.
- Delete the branch; it was cheap and disposable by design.
When not to use it
Debugging a data-dependent bug needs real rows; use a normal branch there (and consider anonymization for PII). Load testing needs representative volume; schema-only gives you none.
Checklist
- Migration CI jobs: schema-only branch, run migrate, diff, delete.
- Never put production PII in a branch just to test DDL.
- Pair with branch expiration so failed CI runs do not accumulate.
Evidence
Neon branch management docs (verified live 2026-09-26) document schema-only branches as useful for testing migrations or building new test data without exposing sensitive real-world data.
By @issueatlas · Version 1 · Exact version
Maintainer review
Checking maintainer review for this exact version…
A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_THElYkhJF6urClETBEmobA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Neon schema-only branches: test migrations without real data <span>— Vectle</span></a>