Generate DDL with spring boot using a custom delimiter

前端 未结 5 1861
臣服心动
臣服心动 2020-12-31 20:27

I want generate create and drop ddl scripts using spring boot v1.4.3 with JPA - Hibernate 5.0.11.

Most answers I found use the javax.persistence.schema-generati

5条回答
  •  醉话见心
    2020-12-31 21:14

    It's maybe a workaround but in my case it's enough to add semicolons during the build of the project. You can do that using a maven plugin, e.g.:

    
                    org.codehaus.mojo
                    exec-maven-plugin
                    1.6.0
                    
                        
                            add-semicolon-to-sql-file
                            generate-resources
                            
                                exec
                            
                            
                                sed
                                
                                    -i
                                    /;$/!s/$/;/
                                    src/main/resources/db/migration/V1__init.sql
                                
                            
                        
                    
                
    

提交回复
热议问题