Restore migration-defined state
Undo manual database changes or experiments made with db push during development.
Prisma · Command
Resets a development database or schema and reapplies all migrations, destroying existing data. It requires confirmation unless --force is supplied.
The command resets the database or schema when possible, recreates it with the same name when needed, and reapplies all migrations. It is intended only for development and requires explicit consent unless you pass --force.
prisma migrate reset [options]| Name | Type | Description |
|---|---|---|
-h, --help | flag | Display command help. |
--config | option | Path to a custom Prisma config file. |
--schema | option | Path to a custom Prisma schema. |
-f, --force | flag | Skip the confirmation prompt. |
Resets the configured database or schema and reapplies all migrations; the CLI reports the operation's result.
npx prisma migrate reset --forceResets the configured development database without asking for confirmation, then reapplies every migration.
Undo manual database changes or experiments made with db push during development.
Resolve migration-history conflicts or schema drift in a development database.
Recreate a clean local database from the committed migration history.
It is a development-only command that resets the database or schema and reapplies the complete migration history. Existing data is destroyed during the reset.
Follow-up: How can the command avoid an interactive confirmation? Pass --force, which skips the confirmation prompt.
The command can drop the database or schema when supported; otherwise, it performs a soft reset. It then creates a replacement with the same name when necessary and applies all migrations.
Follow-up: What configuration controls the datasource? The datasource URL is read from the Prisma config file, such as prisma.config.ts.
Use --force to bypass the confirmation prompt, --schema to select another Prisma schema, and --config to select another Prisma config file. The command is not supported for MongoDB.
Follow-up: What should be used for MongoDB? Use prisma db push instead.
prisma migrate devprisma db pushprisma db seedprisma.config.ts