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.
1.5 KiB
1.5 KiB
prisma migrate reset
Resets your database and re-applies all migrations.
Command
prisma migrate reset [options]
What It Does
- Drops the database (if possible) or deletes all data/tables
- Re-creates the database
- Applies all migrations from
prisma/migrations/ - 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