Hey, how can i run prisma migrate programmatically...
# orm-help
y
Hey, how can i run prisma migrate programmatically when deploying to heroku, right now i have to run the heroku console from the web app, and run
npx prisma migrate
, i'm building everything in docker.
r
Hi @Yassine
I include it in the
postinstall
in `package.json`:
Copy code
"scripts": {
        "postinstall": "yarn prisma generate && yarn prisma migrate deploy --preview-feature ",
   ...
  }
I'm also deploying to Heroku Nodejs framework with the
heroku/nodejs
buildpack (on the settings page) and the postinstall above works for me.
s
I think that's what Heroku's release phase is for.
y
@Richard Ward i tried that, but the prisma migrate didn't recognize the
DATABASE_URL
env variable during postinstall for some reason.
@Simon Knott That's exaclty what i'm looking for.
Thank you so much guys for the help.