Overview on Prisma Migrate (Prisma ORM v6) (/docs/orm/v6/prisma-migrate/understanding-prisma-migrate/overview)
For the complete Prisma documentation index, see llms.txt. A markdown version of any docs page is available by appending
.mdto its URL.
Learn how Prisma Migrate keeps your database schema in sync with your Prisma schema.
Location: ORM > v6 > Prisma Migrate > Understanding Prisma Migrate > Overview on Prisma Migrate
[!NOTE] Does not apply for MongoDB
Instead ofmigrate devand related commands, usedb pushfor MongoDB.
Prisma Migrate enables you to:
- Keep your database schema in sync with your Prisma schema as it evolves and
- Maintain existing data in your database
Prisma Migrate generates a history of .sql migration files, and plays a role in both development and production.
Prisma Migrate can be considered a hybrid database schema migration tool, meaning it has both of declarative and imperative elements:
- Declarative: The data model is described in a declarative way in the Prisma schema. Prisma Migrate generates SQL migration files from that data model.
- Imperative: All generated SQL migration files are fully customizable. Prisma Migrate hence provides the flexibility of an imperative migration tool by enabling you to modify what and how migrations are executed (and allows you to run custom SQL to e.g. make use of native database feature, perform data migrations, ...).
[!NOTE] If you are prototyping, consider using the
db pushcommand - see Schema prototyping withdb pushfor examples.
See the Prisma Migrate reference for detailed information about the Prisma Migrate CLI commands.
Related pages
Section titled “Related pages”About migration histories: About migration historiesAbout the shadow database: About the shadow databaseLegacy Prisma Migrate: Legacy Prisma Migrate is a declarative data modeling and schema migration tool that is available via the Prisma CLI.Limitations and known issues: Learn about current limitations and known issues with Prisma Migrate, including database provider constraints and migration file compatibility.Mental model: A mental model guide for working with Prisma Migrate in your project