Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Data type is not updating on Database

In my entity class, I want to change the data type of a field but it’s not updating in the database. I am using PostgreSQL. I have also tried adding this:

spring.jpa.hibernate.ddl-auto=update

in application properties and still, it doesn’t work I don’t know why, please help, and thanks.

What I have :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id // change Integer into Long data type in the database

>Solution :

If you just created your database and doesn’t have any data in it you can try

spring.jpa.hibernate.ddl-auto=create

update will only update the database rows it won’t alter the table in PostgreSql.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading