<?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"
        xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
    <changeSet id="1" author="cheydt">
        <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
            USE art_relations;;

            DROP TABLE IF EXISTS `ROLLBACK-DIG-7088-cad-manual_adjustments`;;

            CREATE TABLE `ROLLBACK-DIG-7088-cad-manual_adjustments` AS
            SELECT * FROM manual_adjustment WHERE created_by = 339 AND currencies_id = 3 AND parent_type = 'vendor' AND parent_id IN (
            21899, 22456, 21938, 21989, 26035, 21982, 22600, 24533, 25230, 24950, 23560, 26536, 22221, 22240, 23903, 26252, 21927, 25170, 25418, 22966, 22461, 25483, 24578, 22411, 21944, 24953, 7936, 26106, 21953, 24583, 24792, 26809, 22184, 26815, 23581, 26031, 21967, 25826, 21991, 24480, 25442, 21973, 24888, 23547, 22470, 21975, 22474, 10440, 23470, 26688, 25925, 22449, 23562, 26156, 22551, 21981, 22090, 22458, 25422, 22389, 24991, 21928, 24980, 26544, 22089, 26078, 15474, 21958, 22310, 26500, 24403, 22295, 24937, 25237, 23635, 21972, 22188, 23563, 25606, 26658, 23594, 21978, 25395, 26057, 23471, 21983, 26586, 25315, 24434, 21992, 25564, 21957, 21946, 25420, 22430, 23318, 26798, 22250, 21942, 21943, 22323, 22475, 22473, 22465, 22436, 22472, 22160, 22761, 24481, 23354, 25132, 24432, 23657, 21926, 25224, 21932, 25567, 21948, 24992, 23452, 25609, 15906, 22029, 26217, 25367, 22219, 25376, 25536);;

            DELETE FROM manual_adjustment WHERE id IN (SELECT id FROM `ROLLBACK-DIG-7088-cad-manual_adjustments`)
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
                USE art_relations;;

                INSERT INTO manual_adjustment SELECT * FROM `ROLLBACK-DIG-7088-cad-manual_adjustments`;;
            </sql>
        </rollback>
    </changeSet>
</databaseChangeLog>
