apps/docs/content/docs/cli/migrate/index.mdx
The prisma migrate command group provides tools to create and apply database migrations.
:::info
Prisma Migrate does not apply to MongoDB. Use db push instead.
:::
prisma migrate [command] [options]
| Option | Description |
|---|---|
-h, --help | Display help message |
--config | Custom path to your Prisma config file |
--schema | Custom path to your Prisma schema |
| Command | Description |
|---|---|
prisma migrate dev | Create a migration from schema changes, apply it, and trigger generators |
prisma migrate reset | Reset your database and apply all migrations (all data will be lost) |
| Command | Description |
|---|---|
prisma migrate deploy | Apply pending migrations to the database |
prisma migrate status | Check the status of your database migrations |
prisma migrate resolve | Resolve issues with database migrations (baseline, failed migration, hotfix) |
| Command | Description |
|---|---|
prisma migrate diff | Compare the database schema from two arbitrary sources |
# Create and apply a migration in development
prisma migrate dev
# Reset the database (development only)
prisma migrate reset
# Apply pending migrations in production
prisma migrate deploy
# Check migration status
prisma migrate status
# Compare database schemas
prisma migrate diff \
--from-config-datasource \
--to-schema=./prisma/schema.prisma \
--script