~/docs/databases/branching

Dashboard

Databases

Starting data

A copied environment's databases start empty. A Postgres database can start with a copy of its source instead, the source's latest backup, or a seed file from the branch.

Updated

2026-12-02

Source

apps/web/docs/databases/branching.mdx

Two rules hold everywhere:

  • Data flows down, schema flows up. Data goes from a database into its copy, never back. Schema reaches prod through a merge and a deploy.
  • A copy never writes to its source. The source is only read.

The options

Starts withWhat happensCost
Empty (default)Your migrations create the tablesNone
Data from the source nowThe source is dumped and restored into the copyRead load on the source
Latest backupThe newest backup is restoredNone; up to a day old
Seed filephz/seed.sql from the branch runs onceNone; you maintain it

A seed file

phz/seed.sql, read from the copy's branch at the commit it was made from, up to 10 MB. The migrations in phz/migrations/ run first, then the first deploy of every service that uses the database, then the seed, in one transaction. It runs once.