SQLGrammarException on Heroku after changing local database

I created a Java webapp that uses Hibernate and PostgreSQL. It is based on Heroku's Java MVC tutorial ( https://devcenter.heroku.com/articles/spring-mvc-hibernate ). I made some minor changes to the database and correctly updated all the sleep mode annotations. Everything works fine locally, but after clicking on Heroku, I now get this error:

org.hibernate.exception.SQLGrammarException: could not execute query 

...

 Caused by: org.postgresql.util.PSQLException: ERROR: relation "MY_TABLE" does not exist 

So it seems that the database changes that exist on my local machine are not reflected in the heroku cloud. How can I get Heroku to "reset" or "rebuild" my database?

Update . I ran heroku pg:reset , and it ran "Internal Server Error", which told me to "Run" hero status "to check for known problems with the platform", but the launch did not give information. Then I checked the site and it worked again (no data, of course, but expected). Not sure what actually happened, but this fixed the problem. Of course, this helps me completely lose all my data.

+4
source share

Source: https://habr.com/ru/post/1442672/


All Articles