Database migrations

A database migration changes the structure or contents of production data. Tokay treats that change as part of the deployment, but tests it against a copy first so the decision to touch production is based on evidence rather than the command alone.

Last updated

AI agent? Start with llms.txt.

Rehearsal shows what the migration will do

When a deploy includes a migration, Tokay runs the command against a writable copy of the database before production changes.

The rehearsal records whether the command completed, how the schema changed, and whether tables or columns containing data would be removed. A failed rehearsal blocks the migration because it has not shown that the change can complete safely.

Rehearsal evidence decides when you need to approve a migration

You can let routine database changes deploy automatically while keeping control of changes that need judgment. Under Normal release safety, Tokay uses the rehearsal evidence to continue migrations that look safe and pause those that are risky or uncertain.

If a migration needs your approval, Tokay shows you the command, the changes observed during rehearsal, and any data at risk. Production data is unchanged until you confirm the migration or update the code. An AI agent can summarize the evidence, but it must wait for your decision.

A snapshot protects every production change

Before any migration runs against a managed production database, Tokay takes a database snapshot. Restoring that snapshot is an explicit recovery action if the application or data behaves differently than the rehearsal predicted.

You can ask Tokay to pause every migration

In Project Settings, choose Manual under Migration Safety if you want to approve every migration. That setting applies to every Service in the Project unless you choose a different release safety setting for one Service.

The migration command comes from the application

Tokay detects common migration tools used by frameworks and libraries such as Rails, Django, and Prisma. When the command is uncertain, it appears in Service settings as a proposal for review. You can enter an explicit command for a setup Tokay does not detect.

A required migration can hold traffic

Some changes must complete before the new application version can run safely and cannot happen while the old version serves traffic. Tokay can place the Service in maintenance during that part of Go Live.

If the migration fails, visitors receive a clear temporary down response rather than reaching an application with a partially changed schema. Deploy a fix or choose the explicit recovery action to end the hold.

Most deployments do not show any migration decision. The extra steps appear only when the release includes a schema change or data risk.