<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <artifactId>demo</artifactId>
        <groupId>cn.ibizlab</groupId>
        <version>1.0.0.0</version>
    </parent>

    <artifactId>demo-core</artifactId>
    <name>后台服务 Core</name>
    <description>后台服务 Core</description>

    <dependencies>

		<dependency>
			<groupId>cn.ibizlab</groupId>
			<artifactId>ibizlab-boot-starter-data</artifactId>
			<version>2.4.0-SNAPSHOT</version>
		</dependency>
	</dependencies>

    <properties>
        <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
    </properties>
    <profiles>
        <profile>
            <id>diff</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.liquibase</groupId>
                        <artifactId>liquibase-maven-plugin</artifactId>
                        <version>${liquibase.version}</version>
                        <executions>
                            <execution>
                                <id>prepare-newdb</id>
                                <configuration>
                                    <changeLogFile>${project.basedir}/src/main/resources/liquibase/h2_table.xml</changeLogFile>
                                    <driver>org.h2.Driver</driver>
                                    <url>jdbc:h2:file:${project.build.directory}/db/new;MODE=mysql</url>
                                    <username>root</username>
                                    <dropFirst>true</dropFirst>
                                </configuration>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>update</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>prepare-olddb</id>
                                <configuration>
                                    <changeLogFile>${project.basedir}/src/main/resources/liquibase/master_table.xml</changeLogFile>
                                    <driver>org.h2.Driver</driver>
                                    <url>jdbc:h2:file:${project.build.directory}/db/last;MODE=mysql</url>
                                    <username>root</username>
                                    <dropFirst>true</dropFirst>
                                </configuration>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>update</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>make-diff</id>
                                <configuration>
                                    <changeLogFile>${project.basedir}/src/main/resources/liquibase/empty.xml</changeLogFile>
                                    <diffChangeLogFile>${project.basedir}/src/main/resources/liquibase/changelog/${maven.build.timestamp}_changelog.xml</diffChangeLogFile>
                                    <driver>org.h2.Driver</driver>
                                    <url>jdbc:h2:file:${project.build.directory}/db/last;MODE=mysql</url>
                                    <username>root</username>
                                    <password></password>
                                    <referenceUrl>jdbc:h2:file:${project.build.directory}/db/new;MODE=mysql</referenceUrl>
                                    <referenceDriver>org.h2.Driver</referenceDriver>
                                    <referenceUsername>root</referenceUsername>
                                    <verbose>true</verbose>
                                    <logging>debug</logging>
                                    <contexts>!test</contexts>
                                    <diffExcludeObjects>Index:.*,table:ibzfile,ibzuser,ibzdataaudit,ibzcfg,IBZFILE,IBZUSER,IBZDATAAUDIT,IBZCFG</diffExcludeObjects>
                                </configuration>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>diff</goal>
                                </goals>
                            </execution>
                        </executions>

                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>