Migrate

Intuitive data modeling and seamless database migrations using powerful SDL syntax

1
2
3
4
5
6
7
8
9
10
11
12
type User {
  id: ID! @unique
  email: String! @unique
  posts: [Post!]!
}

type Post {
  author: User!
  id: ID! @unique
  title: String!
  published: Boolean!
}
Users
idemailposts
Posts
idauthortitlepublished

Enforced schema for schemaless databases

Prisma ensures the consistency of your data by applying a strong schema over any database.

Store datamodel in version control

Prismas declarative migration system is centered around the datamodel.prisma file that describes all aspects of your database.

Flexible & easy opt-out

Prisma can be used with any migration system. It is easy to get started with Prisma migrations and transition to traditional SQL migration scripts when required.

Powerful data modeling

Use the expressive SDL syntax to define your database schema.

Simple & declarative

SDL takes away the noise from SQL migrations and lets you define a datamodel in a clear and concise way.

Relay-style pagination

The Relay connection model is a powerful way to expose pagination in a GraphQL API. It is supported by Prisma out-of-the-box.

How migrations work

Design your domain model using a simple expressive syntax called SDL. It is easy to learn and allows you to express everything from simple scalar types to relations and embedded documents.

1

Connect Database

Connect Prisma to a new database or introspect an existing database.

2

Define Datamodel

Define your datamodel using the simple and declarative SDL syntax.

3

DB Migration

Migrate your database based on the defined datamodel.

4

SQL Generation

Prisma generates SQL operations and migrates your database

The exciting future of Prisma Migrate

Prisma Migrate is a declarative migration system. In the future we will introduce many new features that make it easier to use in more advanced workflows.

Integrated CI/CD for migrations
Advanced data modeling & Migrations
UI-based migration workflows
Generate migration scripts from datamodel

Be the first to know about updates

Subscribe to the Prisma newsletter to learn about new features as they are released.