0

Context: Our staging and production postgres databases are in a managed SQL service.

Is it recommended to create a local postgres database to run the command the npx prisma migrate dev?

Once the migration files are generated (as a result of running this command), we should then be able to run the npx prisma migrate deploy command on staging and prod environments.

Suparna Gharpure
  • 391
  • 3
  • 10

1 Answers1

1

You are correct. You should only be using npx prisma migrate dev in a local/development database. Once you are done with development and migrations have been created, you apply them to your staging/production database using npx prisma migrate deploy.

I would recommend checking out these two articles from the Prisma docs:

Prisma Migrate: Concept Guide

Deploying database changes with Prisma Migrate

Tasin Ishmam
  • 5,670
  • 1
  • 23
  • 28