Prisma push comand does not update Schema in cloud

Viewed 224

I am using Prisma Cloud to quickly prototyping an app. I connected it to Postgres via Heroku.

I have my schema defined in prisma/schema.prisma.

When I modifiy the schema, the docs say to run the command:

npx prisma db push

When I do so, I received this message in terminal: Your database is now in sync with your schema.

If I go to Prisma Studio, the schema has not change. However, if I push my code to Github, the schema changes.

I was expecting that npx prisma db push would automatically change the schema in the cloud without the need to push on Github. Am I wrong?

1 Answers

npx prisma db push just updates your database schema.

To update your schema.prisma file in Prisma Cloud you are supposed to push the code to the GitHub branch with which you have associated your environment. Each environment in Prisma cloud project has one to one relation with a GitHub branch.

Once you push changes to GitHub, Prisma cloud receives a webhook from GitHub and it then updates the schema. You can see the latest schema of your project in schema tab, attached image for reference.

Prisma Cloud

It also shows the last time when schema was updated.

Related