How to generate a ddl creation script with a modern Spring Boot + Data JPA and Hibernate setup?

前端 未结 3 1918
清酒与你
清酒与你 2020-11-30 23:51

Currently, I\'m using the default @SpringBootApplication annotation with the following properties in application.properties:

spring         


        
3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-01 00:09

    Updating your jpa properties will generate the scripts for you.

                drop-and-create
                ./create_mssql.sql
                ./drop_mssql.sql
    

    This will generate the scripts in the given location. There are other properties as well which can be used on various use-cases, please refer here

    The whole configuration will look like this

    
    
      
        Forge Persistence Unit
        org.hibernate.ejb.HibernatePersistence
        java:jboss/datasources/ExampleDS
        false
        
          
    
          
          
        
      
    
    

提交回复
热议问题