reset

Reset your database and apply all migrations. All data will be lost

The prisma migrate reset command resets your database and re-applies all migrations.

For use in development environments only.

This command is not supported on MongoDB. Use db push instead.

Usage

prisma migrate reset [options]

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

How it works

  1. Drops the database/schema if possible, or performs a soft reset if the environment doesn't allow it
  2. Creates a new database/schema with the same name
  3. Applies all migrations
  4. Runs seed scripts

Options

OptionDescription
-h, --helpDisplay help message
--configCustom path to your Prisma config file
--schemaCustom path to your Prisma schema
-f, --forceSkip the confirmation prompt

Examples

Reset the database

npx prisma migrate reset

Skip confirmation prompt

npx prisma migrate reset --force

Specify a schema path

npx prisma migrate reset --schema=./alternative/schema.prisma

AI safety guardrails

Prisma ORM includes built-in safety checks to prevent accidental destructive commands when run through AI coding assistants.

When AI agents like Claude Code, Cursor, Gemini CLI, or others attempt prisma migrate reset --force, Prisma blocks execution and shows a protective error message.

To proceed, you must provide explicit consent. The AI agent will:

  1. Explain what action it's attempting
  2. Warn that this action irreversibly destroys all data
  3. Confirm whether this is a development or production database
  4. Ask for your explicit consent before proceeding

After consent, the AI sets the PRISMA_USER_CONSENT_FOR_DANGEROUS_AI_ACTION environment variable and reruns the command.

On this page