# resolve (Prisma CLI v7) (/docs/cli/v7/migrate/resolve) > For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL. Resolve issues with database migrations in deployment databases Location: CLI > v7 > migrate > resolve 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. > [!WARNING] > This command is not supported on [MongoDB](https://www.prisma.io/docs/orm/v7/core-concepts/supported-databases/mongodb). Use [`db push`](https://www.prisma.io/docs/cli/v7/db/push) instead. ## Usage [#usage] ```bash prisma migrate resolve [options] ``` The datasource URL configuration is read from the Prisma config file (e.g., `prisma.config.ts`). > [!NOTE] > This command can only be used with a failed migration. Using it with a successful migration results in an error. ## Use cases [#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 [#options] | Option | Description | | --------------- | ------------------------------------------ | | `-h`, `--help` | Display help message | | `--config` | Custom path to your Prisma config file | | `--schema` | Custom path to your Prisma schema | | `--applied` | Record a specific migration as applied | | `--rolled-back` | Record a specific migration as rolled back | You must specify either `--applied` or `--rolled-back`. ## Examples [#examples] ### Mark a migration as applied [#mark-a-migration-as-applied] #### bun ```bash bunx prisma migrate resolve --applied 20201231000000_add_users_table ``` #### pnpm ```bash pnpm prisma migrate resolve --applied 20201231000000_add_users_table ``` #### yarn ```bash yarn prisma migrate resolve --applied 20201231000000_add_users_table ``` #### npm ```bash npx prisma migrate resolve --applied 20201231000000_add_users_table ``` ### Mark a migration as rolled back [#mark-a-migration-as-rolled-back] #### bun ```bash bunx prisma migrate resolve --rolled-back 20201231000000_add_users_table ``` #### pnpm ```bash pnpm prisma migrate resolve --rolled-back 20201231000000_add_users_table ``` #### yarn ```bash yarn prisma migrate resolve --rolled-back 20201231000000_add_users_table ``` #### npm ```bash npx prisma migrate resolve --rolled-back 20201231000000_add_users_table ``` ### Specify a schema path [#specify-a-schema-path] #### bun ```bash bunx prisma migrate resolve --rolled-back 20201231000000_add_users_table --schema=./schema.prisma ``` #### pnpm ```bash pnpm prisma migrate resolve --rolled-back 20201231000000_add_users_table --schema=./schema.prisma ``` #### yarn ```bash yarn prisma migrate resolve --rolled-back 20201231000000_add_users_table --schema=./schema.prisma ``` #### npm ```bash npx prisma migrate resolve --rolled-back 20201231000000_add_users_table --schema=./schema.prisma ``` ## See also [#see-also] * [Resolving migration history issues](https://pris.ly/d/migrate-resolve) ## Related pages - [`deploy`](https://www.prisma.io/docs/cli/v7/migrate/deploy): Apply pending migrations to update the database schema in production/staging - [`dev`](https://www.prisma.io/docs/cli/v7/migrate/dev): Create a migration from changes in Prisma schema, apply it to the database, and trigger generators - [`diff`](https://www.prisma.io/docs/cli/v7/migrate/diff): Compare the database schema from two arbitrary sources - [`reset`](https://www.prisma.io/docs/cli/v7/migrate/reset): Reset your database and apply all migrations. All data will be lost - [`status`](https://www.prisma.io/docs/cli/v7/migrate/status): Check the status of your database migrations