with one click
with one click
prisma db execute. Reference when using this Prisma feature.
prisma db pull. Reference when using this Prisma feature.
prisma db seed. Reference when using this Prisma feature.
prisma debug. Reference when using this Prisma feature.
prisma dev. Reference when using this Prisma feature.
prisma format. Reference when using this Prisma feature.
| name | prisma-cli-db-push |
| description | prisma db push. Reference when using this Prisma feature. |
| license | MIT |
| metadata | {"author":"prisma","version":"7.0.0"} |
Pushes schema changes directly to database without creating migrations. Ideal for prototyping.
prisma db push [options]
| Option | Description |
|---|---|
--force-reset | Force a reset of the database before push |
--accept-data-loss | Ignore data loss warnings |
--schema | Custom path to your Prisma schema |
--config | Custom path to your Prisma config file |
--url | Override the datasource URL from the Prisma config file |
--skip-generate - Run prisma generate explicitlyprisma db push
prisma db push --accept-data-loss
Required when changes would delete data (dropping columns, etc.)
prisma db push --force-reset
Completely resets database and applies schema.
prisma db push
prisma generate # Must run explicitly in v7
migrate deploy| Feature | db push | migrate dev |
|---|---|---|
| Creates migration files | No | Yes |
| Tracks history | No | Yes |
| Requires shadow database | No | Yes |
| Speed | Faster | Slower |
| Rollback capability | No | Yes |
| Best for | Prototyping | Development |
MongoDB doesn't support migrations. Use db push exclusively:
# Schema changes for MongoDB
prisma db push
prisma generate
# Make schema changes
# ...
# Push to database
prisma db push
# Generate client
prisma generate
# Test your changes
# Repeat as needed
prisma db push --force-reset
prisma db seed
If db push can't apply changes safely:
Error: The following changes cannot be applied:
- Removing field `email` would cause data loss
Use --accept-data-loss to proceed
Decide whether data loss is acceptable, then:
prisma db push --accept-data-loss
When ready for production, switch to migrations:
# Create baseline migration from current schema
prisma migrate dev --name init
Then use migrate dev for future changes.