🌐
Prisma
prisma.io › home › getting started with prisma migrate › getting started with prisma migrate › getting started with prisma migrate
Getting started with Prisma Migrate | Prisma Documentation
Then create another new directory with your preferred name. What's important is to use a prefix of 0_ so that Prisma migrate applies migrations in a lexicographic order.
🌐
Prisma
prisma.io › home › overview of prisma migrate › overview of prisma migrate
Prisma Migrate: Database, Schema, SQL Migration Tool | Prisma Documentation
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, ...). If you are prototyping, consider using the db push command - see Schema prototyping with db push for examples.
Discussions

Hassle-Free Database Migrations with Prisma Migrate
So is ready for production? Hella yeah! More on reddit.com
🌐 r/node
17
58
March 16, 2021
How to install Prisma migrations in a new environment?
The same way you run your migrations on your previous dev environment… npx prisma migrate dev Your source code should contain all of your migrations because they’re all dependent on each other and they should be checked in to version control. You can’t just run the latest one because it’s dependent on the ones before it. More on reddit.com
🌐 r/node
1
1
January 23, 2023
How do you handle Prisma's sql migration schemas?
Generate a down migration in addition to each database migration and commit them to your git repository. When you need to rollback to an earlier version, determine which down migrations are needed and run them More on reddit.com
🌐 r/node
5
3
October 15, 2023
prisma migration issue
Did you generate the migrations? I don’t know if Prisma has changed since I last used it, but I don’t recall migrate doing both generation + running. Could be wrong though. More on reddit.com
🌐 r/node
5
0
April 30, 2025
🌐
Wasp
wasp.sh › blog › 2025 › 04 › 02 › an-introduction-to-database-migrations
A Gentle Introduction to Database Migrations in Prisma with Visuals | Wasp
April 2, 2025 - Let's run wasp db migrate-dev which uses the Prisma CLI in the background and you'll get the following code in the migrations/ dir: ... Prisma will then apply the change to your local database (we're using PostgreSQL locally that we started via wasp db start) and this will enable the app to connect to the database and create users, matches and update scores.
🌐
Prisma
prisma.io › home › deploying database changes with prisma migrate › deploying database changes with prisma migrate › deploying database changes with prisma migrate › deploying database changes with prisma migrate
Deploying database changes with Prisma Migrate | Prisma Documentation
To add pgfence as a pre-deploy step in your GitHub Actions workflow: - name: Run migration safety check run: npx @flvmnt/pgfence analyze --ci --max-risk medium prisma/migrations/**/migration.sql - name: Apply all pending migrations to the database run: npx prisma migrate deploy env: DATABASE_URL: ${{ secrets.DATABASE_URL }}
🌐
Prisma
prisma.io › migrate
Prisma Migrate | Database Migrations for Prisma ORM
While prototyping you can create ... 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. 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 ...
🌐
Prisma
prisma.io › home › dev › dev › dev
prisma migrate dev | Create & Apply Migrations | Prisma Documentation
Prisma Next is in early access.Explore the next Prisma ORM workflow.Read the docs ... The prisma migrate dev command creates and applies migrations during development. It requires a shadow database.
🌐
Medium
medium.com › @bryantbrock › data-migrations-with-prisma-94909cb0c0c0
Data migrations with Prisma. For production applications (and… | by Bryant Brock | Medium
December 19, 2023 - Next, create your migration by running npx prisma migrate dev. Add code to begin writing to your new columns (continue writing to your old columns as well — no code should be removed at this stage).
🌐
Prisma
prisma.io › home › understanding migrations › understanding migrations › understanding migrations › understanding migrations
A mental model for Prisma Migrate | Prisma Documentation
Moves your database schema forward to apply missing changes from the Prisma schema and /migrations · You can then apply the changes to your database using prisma db execute command.
Find elsewhere
🌐
Prisma
prisma.io › dataguide › types › relational › migration-strategies
Migrating database schema changes | Prisma's Data Guide
To perform migrations with Prisma, you can use the Prisma Migrate. Developing with Prisma Migrate generates migration files based on the declarative Prisma schema and applies them to your database.
🌐
LogRocket
blog.logrocket.com › home › effortless database schema migration with prisma
Effortless database schema migration with Prisma - LogRocket Blog
June 4, 2024 - To apply this change, all we need to do is tell Prisma to synchronise our changes with the database; we can easily do this by running the following code in the terminal: npx prisma migrate dev --name added_username_column
🌐
GitHub
github.com › prisma › prisma › discussions › 24571
How should migration be done to Production? · prisma/prisma · Discussion #24571
Reflecting Changes in Production DB: You should not use prisma migrate dev in production. Instead, use prisma migrate deploy to apply migrations in a production environment.
Author   prisma
🌐
Prisma
prisma.io › home › postgresql › postgresql › postgresql
Quickstart: Prisma ORM with PostgreSQL (10 min) | Prisma Documentation
import "dotenv/config"; import { defineConfig, env } from "prisma/config"; export default defineConfig({ schema: "prisma/schema.prisma", migrations: { path: "prisma/migrations", }, datasource: { url: env("DATABASE_URL"), }, }); The generated schema uses the ESM-first prisma-client generator with a custom output path: ... generator client { provider = "prisma-client" output = "../generated/prisma" } datasource db { provider = "postgresql" }
🌐
Prisma
prisma.io › home › customizing migrations › customizing migrations › customizing migrations › customizing migrations
Customizing migrations | Prisma Documentation
The pattern involves two components: your application code accessing the database and the database schema you intend to alter. With the expand and contract pattern, renaming the field bio to biography would look as follows with Prisma: Add the new biography field to your Prisma schema and create a migration
🌐
Neon
neon.com › docs › guides › prisma-migrations
Schema migrations with Prisma and Neon - Neon Docs
The typical workflow for schema changes with Prisma and Neon: Modify your schema: Update models in prisma/schema.prisma · Generate migration: Run npx prisma migrate dev --name descriptive-name · Review the migration: Check the generated SQL ...
🌐
Prisma
prisma.io › home › patching & hotfixing › patching & hotfixing › patching & hotfixing › patching & hotfixing
Patching & hotfixing | Prisma Documentation
Patching the production database directly results in schema drift: your database schema has 'drifted away' from the source of truth, and is out of sync with your migration history. You can use the prisma migrate resolve command to reconcile your migration history without having to remove and re-apply the hotfix with prisma migrate deploy. This guide does not apply for MongoDB. Instead of migrate dev, db push is used for MongoDB.
🌐
Medium
medium.com › @s.klop › introduction-to-prisma-migrations-and-database-management-with-prisma-part-8-15-6829a56dda70
Introduction to Prisma: Migrations and Database Management with Prisma — Part 8/13 | by Stephen Klop | Medium
January 31, 2024 - Function: This command creates a new migration file in the prisma/migrations directory, containing SQL statements for your schema changes. Development: Migrations are automatically applied to your development database.
🌐
Prisma
prisma.io › home › expand-and-contract migrations › expand-and-contract migrations › expand-and-contract migrations
How to migrate data with Prisma ORM using the expand and contract pattern | Prisma Documentation
This guide shows you how to use the expand and contract pattern to safely migrate data between columns. We'll walk through a practical example of replacing a boolean field with an enum field while preserving existing data. ... generator client { provider = "prisma-client" output = "./generated/prisma" } datasource db { provider = "postgresql" } model Post { id Int @id @default(autoincrement()) title String content String?
🌐
Prisma
prisma.io › home › deploy › deploy › deploy
prisma migrate deploy | Apply Migrations to Production | Prisma Documentation
Apply pending migrations in production with prisma migrate deploy. No shadow database or schema drift detection. Creates DB if missing.