Prisma Next is in early access.Read the docs

resolve

Resolve issues with database migrations in deployment databases

The prisma migrate resolve command allows you to solve migration history issues in production by marking a failed migration as already applied (supports baselining) or rolled back.

Usage

prisma migrate resolve [options]

The datasource URL configuration is read from the Prisma config file (e.g., prisma.config.ts).

Use cases

  • Recover from failed migrations
  • Baseline databases when starting to use Prisma Migrate on existing databases
  • Reconcile hotfixes done manually on databases with your migration history

Run prisma migrate status to identify if you need to use resolve.

Options

OptionDescription
-h, --helpDisplay help message
--configCustom path to your Prisma config file
--schemaCustom path to your Prisma schema
--appliedRecord a specific migration as applied
--rolled-backRecord a specific migration as rolled back

You must specify either --applied or --rolled-back.

Examples

Mark a migration as applied

bunx prisma migrate resolve --applied 20201231000000_add_users_table

Mark a migration as rolled back

bunx prisma migrate resolve --rolled-back 20201231000000_add_users_table

Specify a schema path

bunx prisma migrate resolve --rolled-back 20201231000000_add_users_table --schema=./schema.prisma

See also

On this page