<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
                    http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd">

    <!-- 初始化数据库表结构 -->
    <changeSet id="v1.0.0-schema" author="qqchen" runOnChange="false" failOnError="true">
        <comment>初始化数据库表结构</comment>
        <sqlFile path="db/changelog/init/v1.0.0-schema.sql"
                 stripComments="false"
                 splitStatements="true"
                 endDelimiter=";"/>
        <rollback>
            <empty/>
        </rollback>
    </changeSet>

    <!-- 初始化基础数据 -->
    <changeSet id="v1.0.0-data" author="qqchen" runOnChange="false" failOnError="true" context="!test">
        <comment>初始化基础数据</comment>
        <sqlFile path="db/changelog/init/v1.0.0-data.sql"
                 stripComments="false"
                 splitStatements="true"
                 endDelimiter=";"/>
        <rollback>
            <empty/>
        </rollback>
    </changeSet>

    <!-- 自动加载 changes 目录下的所有 XML changelog（SQL 文件已分离到外层 sql/ 目录） -->
    <includeAll path="changes/" 
                relativeToChangelogFile="true" 
                errorIfMissingOrEmpty="false"/>
</databaseChangeLog>
