From 3ff55b89f25ea91323bcfedf1e24da228f20a919 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende <gu.martinm@gmail.com> Date: Wed, 20 Jul 2016 22:31:53 +0200 Subject: [PATCH] Spring JPA: improvements in changeLogs.xml (liquibase file) --- .../spring-configuration/liquibase/changeLogs.xml | 28 ++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/SpringJava/JPA/spring-jpa-persistence/src/main/resources/spring-configuration/liquibase/changeLogs.xml b/SpringJava/JPA/spring-jpa-persistence/src/main/resources/spring-configuration/liquibase/changeLogs.xml index 4d558c2..b1af5e1 100644 --- a/SpringJava/JPA/spring-jpa-persistence/src/main/resources/spring-configuration/liquibase/changeLogs.xml +++ b/SpringJava/JPA/spring-jpa-persistence/src/main/resources/spring-configuration/liquibase/changeLogs.xml @@ -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> -- 2.1.4