migrate dev

Record schema changes as a migration, confirm removals, reconcile forks, and regenerate every client.

repost schema migrate dev diffs your schema against the last migration. When something changed, it writes a timestamped snapshot under repost/migrations/, bumps the version of each affected event type, and regenerates every client. When nothing changed, the migrations tree is untouched and clients still regenerate, matching Prisma's behavior.

Usage

repost schema migrate dev [options]

Options

OptionDescription
--name <name>Name for the migration directory, slugged into <timestamp>_<name>. Prompted on a terminal when omitted; required in CI.
--accept-removalsProceed without prompting when the migration removes event types.
--schema <path>A .repost file or a directory of them. Defaults to ./repost/schema.repost, else ./repost/schema/.

What it does

  1. Validates the schema and resolves every generator's output. Failures abort with nothing written.
  2. Diffs against the previous migration, or against both heads when the history has a fork; migrate dev is the one command that reconciles a fork.
  3. If event types would be removed, lists them and asks Remove these event types? [y/N]:. In a non-interactive shell it errors instead unless --accept-removals is passed, so a removal never ships unnoticed.
  4. Resolves the name: --name, or a prompt on a terminal. Without a terminal and without --name, it errors and writes nothing.
  5. Writes the migration directory and regenerates all clients.

Exit code 1 on an invalid schema, a tampered snapshot, an unconfirmed removal, or a missing name in CI.

Examples

repost schema migrate dev --name add_subtitle
Created migration `20260718090000_add_subtitle`:
  modified  book.created (version 1 → 2)

A run with no schema changes:

No changes detected — the schema matches the latest migration.

Reconciling after merging two branches that each wrote a migration:

Reconciled a fork of 2 migrations into `20260718091500_reconcile`:
  vs 20260716120000_branch_a:
    added     invoice.paid (version 1)
  vs 20260717090000_branch_b:
    added     book.created (version 1)

Continue