Prisma Migrate uses Prisma schema changes to automatically generate fully customizable database schema migrations
1model User {2 id Int @id @default(autoincrement())3 email String @unique4 name String?5}
-- CreateTableCREATE TABLE "User" ( "id" SERIAL NOT NULL, "email" TEXT NOT NULL, "name" TEXT, PRIMARY KEY ("id"));
-- CreateIndexCREATE UNIQUE INDEX "User.email_unique" IN "User"("email");
Iteration
While prototyping you can create the database schema quickly using the prisma db push
command without creating migrations.
Quickly seed your database with data by defining a seed script in JavaScript, TypeScript or Shell.
Migrate detects database schema drift and assists you in resolving them.
Deployment
Migrate supports dedicated workflows for carrying out migrations safely in production.
Migrate can be integrated into CI/CD pipelines, e.g. GitHub Actions, to automate applying migrations before deployment.
Migrate keeps track of applied migrations and provides tools to detect and resolve conflicts and drifts between migrations and the database schema.