Is there a way to run migrations from code? I'm tr...
# prisma-client
b
Is there a way to run migrations from code? I'm trying to run
npx prisma migrate deploy
within a Jest global setup script, and it works locally but fails when running in GitHub Actions CI, saying
Copy code
/usr/bin/env: 'node': No such file or directory
Command failed: npx prisma migrate deploy
No idea why it's happening since Node is definitely in the path, but being able to run migrations from code (e.g.
prismaClient.runMigrations()
) would still be super useful for test setup I imagine it'd probably be necessary to specify the path to the Prisma schema/migrations directory in case the current working directory doesn't include them
r
@Ben Ezard 👋 You can run it from code via
exec
and passing the command line argument. Currently we have a request for this so it would be great if you could add a 👍 to the request 🙂 I currently do the same for my tests here on GitHub Actions and it works fine.
b
@Ryan ahh, not sure how I missed that! And awesome, thanks, I'll take a look at your setup 🙂
💯 2