So I removed this attribute called price from my entity class.
But when running my spring-boot server, it still think its still in the table.
My application.properties is configured as such: spring.jpa.hibernate.ddl-auto=update.
I can’t use create drop because I got some data in other tables I don’t want to re enter
I’d manually delete the column and then every now and then at random runs of my application the column comes back and I’d have to manually delete again, any idea why? and how to fix.
3
When using spring.jpa.hibernate.ddl-auto = update, Hibernate attempts to update the database schema without deleting any data. This means that it won’t automatically drop columns even if they no longer exist in your entity class. As a result, the issue may persist due to the column lingering in the database schema.
Hibernate’s schema may be cached or not in sync with the actual database on occasion. To make sure Hibernate reflects the latest state of your entity, either clear any cache (if enabled) or restart the application after making changes.
You can clean the cache at the Application level
spring.jpa.properties.hibernate.cache.use_second_level_cache = false
3