Files
NextChair/.agents/skills/prisma-cli/references/migrate-reset.md
T
Stefan Lazic 090646fdfd Phase 2
Base app architecture:

    Route groups for customer, staff and owner.
* Reusable design system with around 20 UI components.
* Complete Prisma schema.
* Authentication with email/password and Google.
* Role and permission model.
* Protected routes.
* Clean separation between features, services, components and shared utilities.
2026-08-02 17:47:23 +01:00

1.5 KiB

prisma migrate reset

Resets your database and re-applies all migrations.

Command

prisma migrate reset [options]

What It Does

  1. Drops the database (if possible) or deletes all data/tables
  2. Re-creates the database
  3. Applies all migrations from prisma/migrations/
  4. Stops there - run seed and generate explicitly if needed

Warning: All data will be lost.

Options

Option Description
--force / -f Skip confirmation prompt
--schema Path to schema file
--config Custom path to your Prisma config file

Examples

Basic reset

prisma migrate reset

Prompts for confirmation in interactive terminals.

Force reset (CI/Automation)

prisma migrate reset --force

With custom schema

prisma migrate reset --schema=./custom/schema.prisma

When to Use

  • Development: When you want a fresh start
  • Testing: Resetting test database before suites
  • Drift Recovery: When the database is out of sync and you can't migrate

Follow-up Steps

Run prisma generate and prisma db seed explicitly when you need refreshed client output or seed data after a reset.

Configuration

Configure the seed script in prisma.config.ts, then run it explicitly after reset:

export default defineConfig({
  migrations: {
    seed: 'tsx prisma/seed.ts',
  },
})

Typical workflow:

prisma migrate reset --force
prisma generate
prisma db seed