Feedback on migrate command names #5716
Labels
kind/feedback
Issue for gathering feedback.
team/schema
Issue for team Schema.
topic: prisma migrate dev
CLI: prisma migrate dev
Milestone
Problem
It is confusing to switch between
prisma db ...
andprisma migrate ...
The command name
prisma migrate dev
is 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 push
mostly, reservingmigrate dev
for right before committing (for details on our workflow refer to #5714). Themigrate deploy
step is like some kind of production-safe version ofdb 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!
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
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
orprisma 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
andapply
too though. For example Terraform uses theapply
term.The text was updated successfully, but these errors were encountered: