Browse Source

build: 禁用jpa修改数据库,增加ddl.sql文件记录ddl操作

suntg 7 years ago
parent
commit
f3e2009cb3
2 changed files with 9 additions and 1 deletions
  1. 8 0
      db/ddl.sql
  2. 1 1
      src/main/resources/META-INF/persistence.xml

+ 8 - 0
db/ddl.sql

@@ -0,0 +1,8 @@
+-- 项目ddl SQL语句统一放在这里记录,包括表结构、关联关系、索引、函数、存储过程等
+
+-- 每段sql语句必须要按规范注释,注释规范如下:
+-- date: 2018-12-11
+-- author: suntg
+-- content: 内容备注xxx
+
+

+ 1 - 1
src/main/resources/META-INF/persistence.xml

@@ -16,7 +16,7 @@
 				to modify an existing database; value="create-drop" means the same as "create" 
 				but also drops tables when Hibernate closes; value="validate" makes no changes 
 				to the database -->
-			<property name="hibernate.hbm2ddl.auto" value="update" />
+			<property name="hibernate.hbm2ddl.auto" value="none" />
 			<property name="hibernate.ejb.naming_strategy" value="org.hibernate.cfg.ImprovedNamingStrategy" />
 			<property name="hibernate.connection.charSet" value="UTF-8" />
 			<!-- Uncomment the following two properties for JBoss only -->