Problem
-
It is confusing to switch between prisma db ... and prisma migrate ...
-
The command name prisma migrate dev is confusing because the convention of dev (I feel) is to enter some kind of watch mode.
Suggested solution
So there are three commands:
prisma migrate dev
prisma migrate deploy
prisma db push
Locally, we use db push mostly, reserving migrate dev for right before committing (for details on our workflow refer to #5714). The migrate deploy step is like some kind of production-safe version of db push to us (IIUC one difference is that deploy is based on the migrations and push is based on the prisma schema).
The following is an attempt at naming that matching how I think/use these commands. This might not align with how others see it/use it, of course!
prisma migrate preview <-- prisma db push
prisma migrate commit <-- prisma migrate dev
prisma migrate deploy
Firstly, I think one command namespace is easier to understand than two. But maybe there are future plans for these namespaces that would make me reconsider?
-
prisma migrate preview
We see this as the first step in the workflow. It doesn't save a migration file and it is based on the state of the the Prisma schema file, not the migrations. Thus its a kind of "preview". As a user I think to myself
I want to check out/try out the current state of my PSL+app right now. I don't know if this will work or is what I want, let's find out.
-
prisma migrate commit (alt ideas: prisma migrate create, prisma migrate save)
This follows from a preview. It is the point where I'm ready to commit to the changes in my PSL. The word "commit" here is intentionally trying to align with git terminology. The analogy is that migrations are like git commits––a sequential diff timeline and an artifact saved to disk.
However, "commit" might be confusing to users with an ops point of view, thinking that "commit" means some kind of deployment. Thus perhaps prisma migrate create or prisma migrate save are better words here.
-
prisma migrate deploy (alt ideas: prisma migrate up, prisma migrate apply)
Finally deployment comes. This name seems reasonable to me. I think a case could be made for up and apply too though. For example Terraform uses the apply term.
Problem
It is confusing to switch between
prisma db ...andprisma migrate ...The command name
prisma migrate devis confusing because the convention ofdev(I feel) is to enter some kind of watch mode.Suggested solution
So there are three commands:
Locally, we use
db pushmostly, reservingmigrate devfor right before committing (for details on our workflow refer to #5714). Themigrate deploystep is like some kind of production-safe version ofdb pushto us (IIUC one difference is that deploy is based on the migrations and push is based on the prisma schema).The following is an attempt at naming that matching how I think/use these commands. This might not align with how others see it/use it, of course!
Firstly, I think one command namespace is easier to understand than two. But maybe there are future plans for these namespaces that would make me reconsider?
prisma migrate previewWe see this as the first step in the workflow. It doesn't save a migration file and it is based on the state of the the Prisma schema file, not the migrations. Thus its a kind of "preview". As a user I think to myself
prisma migrate commit(alt ideas:prisma migrate create,prisma migrate save)This follows from a preview. It is the point where I'm ready to commit to the changes in my PSL. The word "commit" here is intentionally trying to align with git terminology. The analogy is that migrations are like git commits––a sequential diff timeline and an artifact saved to disk.
However, "commit" might be confusing to users with an ops point of view, thinking that "commit" means some kind of deployment. Thus perhaps
prisma migrate createorprisma migrate saveare better words here.prisma migrate deploy(alt ideas:prisma migrate up,prisma migrate apply)Finally deployment comes. This name seems reasonable to me. I think a case could be made for
upandapplytoo though. For example Terraform uses theapplyterm.