<?xml version="1.0" encoding="UTF-8"?>
<!--
 This file is part of the Meeds project (https://meeds.io/).

 Copyright (C) 2020 - 2025 Meeds Association contact@meeds.io

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 3 of the License, or (at your option) any later version.
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public License
 along with this program; if not, write to the Free Software Foundation,
 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-->
<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-3.4.xsd">
    <changeSet author="quartz" id="1.0.0-1" dbms="hsqldb">
        <sqlFile
                encoding="utf8"
                endDelimiter=";"
                path="db/sql/tables_hsqldb.sql"
                relativeToChangelogFile="false"
                splitStatements="true"
                stripComments="true"/>
    </changeSet>
    <changeSet author="quartz" id="1.0.0-2" dbms="mysql">
        <sqlFile
                encoding="utf8"
                endDelimiter=";"
                path="db/sql/tables_mysql_innodb.sql"
                relativeToChangelogFile="false"
                splitStatements="true"
                stripComments="true"/>
    </changeSet>
    <changeSet author="quartz" id="1.0.0-3" dbms="mssql">
        <sqlFile
                encoding="utf8"
                endDelimiter="\nGO"
                path="db/sql/tables_sqlServer.sql"
                relativeToChangelogFile="false"
                splitStatements="true"
                stripComments="true"/>
    </changeSet>
    <changeSet author="quartz" id="1.0.0-4" dbms="postgresql">
        <sqlFile
                encoding="utf8"
                endDelimiter=";"
                path="db/sql/tables_postgres.sql"
                relativeToChangelogFile="false"
                splitStatements="true"
                stripComments="true"/>
    </changeSet>
    <!--Oracle should run drop tables outside sql script-->
    <changeSet author="quartz" id="1.0.0-5" dbms="oracle">
        <preConditions onFail="MARK_RAN">
            <tableExists tableName="QRTZ_FIRED_TRIGGERS"/>
        </preConditions>
        <dropTable tableName="QRTZ_FIRED_TRIGGERS"/>
    </changeSet>
    <changeSet author="quartz" id="1.0.0-6" dbms="oracle">
        <preConditions onFail="MARK_RAN">
            <tableExists tableName="QRTZ_PAUSED_TRIGGER_GRPS"/>
        </preConditions>
        <dropTable tableName="QRTZ_PAUSED_TRIGGER_GRPS"/>
    </changeSet>
    <changeSet author="quartz" id="1.0.0-7" dbms="oracle">
        <preConditions onFail="MARK_RAN">
            <tableExists tableName="QRTZ_SCHEDULER_STATE"/>
        </preConditions>
        <dropTable tableName="QRTZ_SCHEDULER_STATE"/>
    </changeSet>
    <changeSet author="quartz" id="1.0.0-8" dbms="oracle">
        <preConditions onFail="MARK_RAN">
            <tableExists tableName="QRTZ_LOCKS"/>
        </preConditions>
        <dropTable tableName="QRTZ_LOCKS"/>
    </changeSet>
    <changeSet author="quartz" id="1.0.0-9" dbms="oracle">
        <preConditions onFail="MARK_RAN">
            <tableExists tableName="QRTZ_SIMPLE_TRIGGERS"/>
        </preConditions>
        <dropTable tableName="QRTZ_SIMPLE_TRIGGERS"/>
    </changeSet>
    <changeSet author="quartz" id="1.0.0-10" dbms="oracle">
        <preConditions onFail="MARK_RAN">
            <tableExists tableName="QRTZ_SIMPROP_TRIGGERS"/>
        </preConditions>
        <dropTable tableName="QRTZ_SIMPROP_TRIGGERS"/>
    </changeSet>
    <changeSet author="quartz" id="1.0.0-11" dbms="oracle">
        <preConditions onFail="MARK_RAN">
            <tableExists tableName="QRTZ_CRON_TRIGGERS"/>
        </preConditions>
        <dropTable tableName="QRTZ_CRON_TRIGGERS"/>
    </changeSet>
    <changeSet author="quartz" id="1.0.0-12" dbms="oracle">
        <preConditions onFail="MARK_RAN">
            <tableExists tableName="QRTZ_BLOB_TRIGGERS"/>
        </preConditions>
        <dropTable tableName="QRTZ_BLOB_TRIGGERS"/>
    </changeSet>
    <changeSet author="quartz" id="1.0.0-13" dbms="oracle">
        <preConditions onFail="MARK_RAN">
            <tableExists tableName="QRTZ_TRIGGERS"/>
        </preConditions>
        <dropTable tableName="QRTZ_TRIGGERS"/>
    </changeSet>
    <changeSet author="quartz" id="1.0.0-14" dbms="oracle">
        <preConditions onFail="MARK_RAN">
            <tableExists tableName="QRTZ_JOB_DETAILS"/>
        </preConditions>
        <dropTable tableName="QRTZ_JOB_DETAILS"/>
    </changeSet>
    <changeSet author="quartz" id="1.0.0-15" dbms="oracle">
        <preConditions onFail="MARK_RAN">
            <tableExists tableName="QRTZ_CALENDARS"/>
        </preConditions>
        <dropTable tableName="QRTZ_CALENDARS"/>
    </changeSet>
    <changeSet author="quartz" id="1.0.0-16" dbms="oracle">
        <sqlFile
                encoding="utf8"
                endDelimiter=";"
                path="db/sql/tables_oracle.sql"
                relativeToChangelogFile="false"
                splitStatements="true"
                stripComments="true"/>
    </changeSet>
</databaseChangeLog>
