# Deploy database migrations safely

Reduce the risk of changing production data without turning migrations into a separate release process. Tokay rehearses each migration against a writable copy of your data, shows you destructive effects, and takes a snapshot before an approved destructive change reaches production.

## Problems appear before production changes

You do not have to learn about a bad migration from the live database. During deployment, Tokay runs the migration against a copy that has the same data shape as production and compares the schema before and after.

Safe additive changes continue through the deploy. A migration that fails rehearsal cannot be confirmed, so it never reaches production.

## Destructive changes wait for you

Tokay keeps consequential data decisions with a human, so an automated deploy cannot silently remove production data. When rehearsal finds a destructive change, the deploy pauses and shows what will run, what will change, and what data would be lost.

Production is untouched while the deploy waits. Before an approved destructive migration runs, Tokay takes a database snapshot that you can restore explicitly if needed.

## Your normal migration tools still drive the change

Migration safety does not add another configuration system to maintain. Tokay detects the commands already used by Prisma, Django, Rails, and other supported tools. When a command needs confirmation, we show it before it runs.

Projects can require confirmation for every migration or allow safe changes to continue unattended, with an override available for individual Services.

## AI written migrations keep a human gate

A coding agent like Claude Code or Codex can deploy routine schema changes without being allowed to approve destructive ones. Through Tokay's GraphQL API, the agent submits and deploys the migration, while Tokay runs the rehearsal and sends destructive evidence to a human for confirmation.

See [database migrations](/docs/database-migrations) for the full behavior.

Tokay has a very generous free tier with no credit card. [Get started](/getting-started).
