> ## Documentation Index
> Fetch the complete documentation index at: https://repost.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# repost schema 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

```bash theme={"languages":{"custom":["/languages/repost.json"]}}
repost schema migrate dev [options]
```

## Options

| Option              | Description                                                                                                               |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `--name <name>`     | Name for the migration directory, slugged into `<timestamp>_<name>`. Prompted on a terminal when omitted; required in CI. |
| `--accept-removals` | Proceed 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](/docs/send/deployments#merging-branches); `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

```bash theme={"languages":{"custom":["/languages/repost.json"]}}
repost schema migrate dev --name add_subtitle
```

```text theme={"languages":{"custom":["/languages/repost.json"]}}
Created migration `20260718090000_add_subtitle`:
  modified  book.created (version 1 → 2)
```

A run with no schema changes:

```text theme={"languages":{"custom":["/languages/repost.json"]}}
No changes detected — the schema matches the latest migration.
```

Reconciling after merging two branches that each wrote a migration:

```text theme={"languages":{"custom":["/languages/repost.json"]}}
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

<Columns cols={3} className="gap-y-4">
  <Card title="migrate status" icon="list-checks" href="/docs/cli/schema/migrate-status" cta="CI gate" arrow="true">
    Verify the recorded history stays clean.
  </Card>

  <Card title="migrate deploy" icon="upload" href="/docs/cli/schema/migrate-deploy" cta="Deploy" arrow="true">
    Put the recorded migrations live.
  </Card>

  <Card title="Migrations & deploys" icon="git-branch" href="/docs/send/deployments" cta="Concepts" arrow="true">
    Forks, checksums, and the versioning model.
  </Card>
</Columns>
