Spring JPA: improvements in changeLogs.xml (liquibase file)
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Wed, 20 Jul 2016 20:31:53 +0000 (22:31 +0200)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Wed, 20 Jul 2016 20:31:53 +0000 (22:31 +0200)
SpringJava/JPA/spring-jpa-persistence/src/main/resources/spring-configuration/liquibase/changeLogs.xml

index 4d558c2..b1af5e1 100644 (file)
@@ -5,15 +5,35 @@
         xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
         http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
 
+       <!--
+               We do not need this configuration because our driver take cares of creating
+               mybatis_example if it does not exist because we are using these options:
+               
+               MYSQL: createDatabaseIfNotExist
+               H2: INIT=create schema if not exists mybatis_example
+               
+               :)
+               
+       <changeset author="gustavo" id="1">
+               <sql>
+                       create schema if not exists mybatis_example
+               </sql>
+       </changeset>
+       -->
+
     <!-- DDL -->
     <include file="spring-configuration/liquibase/ddlChangelog.xml" />
 
-    <!-- DML -->
-    <include file="spring-configuration/liquibase/dmlChangelog.xml" />
     <!--
-    <changeSet author="gustavo" id="1">
-        <sqlFile path="liquibase/dmlChangelog.xml" stripComments="true"/>
+    <changeSet author="gustavo" id="2">
+       Instead of using liquibase for loading data (dmlChangelog.xml), we could be using SQL statements.
+       
+        <sqlFile path="liquibase/dml.sql" stripComments="true"/>
     </changeSet>
     -->
 
+    
+    <!-- DML -->
+    <include file="spring-configuration/liquibase/dmlChangelog.xml" />
+
 </databaseChangeLog>