# Migrations — BrandApp Playground

> Data-aware schema migrations for changes that must move record values, not just reshape the schema.

- Canonical page: https://brandapp-playground.vercel.app/eav/migrate
- Markdown: https://brandapp-playground.vercel.app/eav/migrate.md
- SDK module: `@reopt-ai/brandapp-sdk/eav/migrate`

## When to reach for this

Schema sync is declarative and handles most changes. Migrations are the imperative escape
hatch for changes that must also move record data — the classic case being a rename that
has to preserve every existing value (expand → backfill → contract).

## Surface

- `defineMigration()` — author a forward and optional reverse migration
- `runMigration()` — execute up/down against a live client, guarded by a checksum
- `runMigrationCollecting()` — buffer schema ops for one atomic server-side apply
- `createMigrationContext()` — build the context yourself for scripted runs

Documentation page — migrations mutate schema and data and require a checksum plus a real
backend, so they are shown as references rather than run against the dev server.

## Related

- [Schema Sync](https://brandapp-playground.vercel.app/eav/sync.md)
- [Schema Definition](https://brandapp-playground.vercel.app/eav/schema.md)

---

Index of every document: https://brandapp-playground.vercel.app/llms.txt
Single-file copy: https://brandapp-playground.vercel.app/llms-full.txt
HTTP API description: https://brandapp-playground.vercel.app/openapi.json
