Another Q: is there a preferred way in `package.js...
# orm-help
m
Another Q: is there a preferred way in
package.json
to toggle migration commands when deploying? I.e. to run
prisma migrate dev
vs
prisma migrate deploy
dependent on environment (preview vs prod)?
d
dev should only be for dev environments, I presume preview is a staging environment so should use deploy
plus one +1 1
m
gotcha, so I'd just put
prisma migrate deploy
in a postinstall hook then?
That's easy enough
d
I wouldnt put it in the postinstall, I would include it in your build scripts
plus one +1 1
so in my ci, I build the docker container, run all the tests, if everything is ok, I run deploy and start the container after successful migration
plus one +1 1
m
Gotcha. Thanks!
j
Also can recommend to run install / build before and if successful deploy
m
Thanks @Joël! That
vercel-build
script is key, was hard to find the docs for that.
💚 1
👍 1