0

Im using Spring for a web app and using anotations to define columns but when i change a column type that change is not reflected to my database.

Example:

  @Column(name = "detail")
  private String detail;

Changes to:

  @Column(name = "detail")
  private int detail;

My app.propierties:

spring.datasource.url = jdbc:mysql://localhost:3306/exampleapp
spring.datasource.username = root
spring.datasource.password = root
spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1
spring.jpa.show-sql = true
spring.jpa.hibernate.ddl-auto = update
spring.jpa.properties.hibernate.dialect =       org.hibernate.dialect.MySQL5Dialect
Jeypi
  • 25
  • 7

1 Answers1

0

You need to add the following property. This will update your scheme when you run your application.

spring.jpa.hibernate.ddl-auto = update
Alain Cruz
  • 4,757
  • 3
  • 25
  • 43