Table 'DBNAME.hibernate_sequence' doesn't exist

前端 未结 5 1369
离开以前
离开以前 2020-12-29 17:45

I have a SpringBoot 2.0.1.RELEASE application using spring data / jpa


    org.sprin         


        
5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-29 18:30

    JPA and Auto-DDL

    When I run into mapping mismatches between a table schema and a java entity I like to do the following.

    1. Drop the schema
    2. Add the spring.jpa.hibernate.ddl-auto=create property to application.properties
    3. Restart your application

    This will now recreate the schema based on your entity. You can then compare the created table against your old schema to see the difference, if necessary.

    Warning : This will truncate the data in all tables specified as entities in your application

提交回复
热议问题