What you’ll build
- A SQLite e-commerce database with a seeded base schema
- Three parallel migration branches: premium-user features, inventory tracking, analytics
- A workflow for comparing the three outcomes side by side
- Time: ~25 minutes
Prerequisites
- Vers CLI installed and authenticated
- Basic familiarity with SQL
The idea
The expensive part of testing a migration isn’t the migration — it’s the base state the migration modifies. You want to test three different premium-features implementations against the same seeded database, and traditionally that means reseeding three times. With Vers you seed once, branch the live VM (which includes the SQLite file’s exact page layout, WAL state, and any in-memory buffers), then apply a different migration to each branch. Every branch sees the same starting data; each diverges only in the migration you run.Step 1: Initialize the project
vers.toml resources are fine for SQLite:
Step 2: Boot the VM and seed the base schema
Step 3: Branch at the pre-migration state
This is the decision point. Three migration candidates, one base state:db-root as the baseline, three children each with an identical copy of the seeded database. No reseeding, no reset scripts.
Step 4: Apply three migrations in parallel
Each migration goes on its own branch. For genuine parallelism, open three terminals; for a linear read, just run them one after the other — thevers execute form is fine.
Migration A — premium user features
Migration B — inventory management
Migration C — analytics tables
Step 5: Compare outcomes
Theinspect.sh helper you wrote in Step 2 is present in every branch — they inherit the parent’s filesystem at branch time. Run it on each:
Confirm the baseline is untouched
The root VM is exactly where you left it at Step 2:premium_benefits, no suppliers, no page_views. The migrations live only on their branches.
Step 6: Branch a branch — test a rollback scenario
A branch is itself a VM you can branch. Say you want to apply a risky secondary migration on top ofmigration-premium without disturbing it:
Step 7: Clean up
-r tears down the root and all descendants.
The pattern
Seed expensive state once, branch at the decision point, diverge per scenario. Databases happen to be the cleanest example because the setup cost (schema + seed data) is visibly expensive, but the pattern is the same one as parallel scenario testing and agent swarms:- The setup prefix is paid once, at commit time
- Every fork inherits the exact state — byte-identical, memory and filesystem both
- Divergence only costs what it actually writes
vers commit and you have a rollback primitive strong enough that “test three migrations and keep the best one” becomes one afternoon of work, not one sprint.
What’s next
Parallel scenario testing
Same pattern applied to end-to-end HTTP testing against a live stateful service.
Agent swarms
Branch a golden state into parallel coding agents.
vers branch
Every flag on the branch primitive.
Architecture
How commits, overlays, and content addressing make migration testing cheap.