Skip to main content
meridian migrate runs prisma migrate dev against your developer database with a snapshot taken first, so a half-applied migration is recoverable.
The sequence is: dump the schema to .meridian/snapshots/, run the migration, and, if it fails, reset the schema and replay the snapshot automatically. A half-applied migration is worse than where you started, so the rollback is the default rather than an option. From a script or a coding agent, always pass --name: without a terminal Prisma can’t ask for one. Pass --yes too if the schema still lacks shadowDatabaseUrl (see Prepare Prisma). Two cases still need a person:
  • A migration that would lose data (dropping a column or a table with rows). Prisma asks to confirm, and without a terminal it stops with “Prisma Migrate has detected that the environment is non-interactive”. Run that migration from your own terminal.
  • A database that drifted from the migration history. Prisma says it needs to reset the database and stops, terminal or not. meridian db reset --yes --migrate rebuilds it from your migrations, and drops its data.
--no-rollback is the one worth knowing: it leaves the database in its failed state and keeps the snapshot, so you can inspect what went wrong before deciding to restore. --skip-snapshot gives you neither. Snapshots are pruned only after a successful run, so a string of failures never eats the snapshot you still need. --keep-snapshots sets how many survive that pruning.

Next to meridian dev

While meridian dev runs for the same app, meridian migrate uses its database connection instead of opening one, and says so in one line, with that session’s port and pid. The dev server keeps serving through the migration, and through the rollback when one fails. Run on its own, meridian migrate opens a connection for the length of the run. Either way, Prisma gets DATABASE_URL and SHADOW_DATABASE_URL in its environment, and .env is left untouched. With --json, the result carries reused_session: true when the run used the running meridian dev, and false when it opened its own connection.

Other Prisma flags

Flags meridian migrate does not know go to Prisma after a --:
A mistyped Meridian flag is refused rather than passed on, because Prisma would only fail after the snapshot and trigger a rollback. Give the name once: --name together with --name (or -n) after -- is refused before anything starts. meridian migrate -- --name add_orders still works on its own.

Where a migration shows up

Every migration run is reported back to Meridian, so the app’s Developer databases page and Meridian MCP’s dev_database_migrate see the same history. A migration you ran from your terminal is visible to your team without you telling them.
Last modified on November 10, 2026