<?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-usd-manual_adjustments`;;

            CREATE TABLE `ROLLBACK-DIG-7088-usd_manual_adjustments` AS
            SELECT * FROM manual_adjustment ma
            WHERE ma.parent_id in
            (26205,26205,26205,26205,26205,26205,26205,26205,24480,24480,24480,24480,25359,25359,25359,25359,25359,25359,25359,25359,25359,25359,25605,25605,25605,25170,25238,25238,22464,22464,22464,22464,22464,22464,22464,22464,22464,22464,22464,22464,22464,24950,23318,23318,22460,22460,22460,24991,24991,24991,24991,24991,24992,24992,23657,23657,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,24578,24578,24578,24578,24578,24578,24578,24578,24578,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,22240,24432,24432,24954,24954,24954,24954,24954,24954,24954,24954,24954,24954,24954,22456,22456,22456,22456,22456,22456,22456,22456,22456,22456,22456,22456,22456,22456,26252,26252,26252,26252,26252,26252,26252,21926,21926,21927,21927,21927,21927,21927,21927,21927,21928,22966,22966,22966,21931,22250,22250,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,24980,24980,22461,22461,22461,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22296,22388,22388,26030,26030,26030,26030,26030,26030,26030,22450,22450,22450,22450,22450,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,15826,22411,22411,22411,22411,22411,22411,22411,22411,22411,22411,22411,22411,22411,22411,22411,22411,22411,22411,22411,22411,22411,22411,22411,22411,22411,22411,21943,21943,21943,21943,21943,21943,21944,21944,21933,21933,21945,21945,21945,21945,21946,21946,22323,22323,22323,22323,22323,22323,22323,22323,22323,22323,22323,22323,22323,22323,22323,24953,24953,24953,24953,24953,24953,24953,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,21950,21950,21950,21950,21950,21950,21950,22089,22089,22089,22089,22089,22089,26078,26078,26078,26078,26078,26078,26078,26078,26078,26078,26078,26078,25420,25420,25420,25420,25420,25420,25420,25230,25230,25230,25230,25230,25230,25230,25230,25230,21956,21958,21958,24792,24792,24792,24792,24792,24792,24792,24792,24792,24792,24792,24792,24792,24792,23561,23561,23561,23561,23561,23561,22430,22430,22430,22430,22430,22430,22430,22184,22184,22184,22184,22184,22184,22184,22184,22184,22184,22184,22184,26815,26815,26815,26815,26815,26815,26815,26815,26293,25215,22478,22478,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,24419,23581,23581,23581,23581,23581,23581,23581,23581,23581,23581,23581,22249,20651,20651,20651,20651,25153,25153,25153,25153,25153,25153,25153,22187,22187,22187,22187,22187,22187,22187,22187,22187,22187,22187,22187,22187,22187,26031,26031,26031,26031,26031,26031,26031,26031,26031,26031,26031,26031,26031,26031,21967,21967,21967,21967,21967,21967,21967,21967,21967,21967,21967,21967,21967,21967,21967,21967,21967,21967,21967,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21963,21963,23441,23441,22295,22295,25826,25826,25826,24937,21968,21968,21968,23354,23354,23354,23635,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,22600,25442,25609,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,22188,21973,21973,21973,21973,21973,21973,21973,21973,21973,24888,24888,24888,24888,24888,24888,24888,24888,24888,24888,24888,24888,24888,24888,24888,24888,24888,24888,24888,24888,24888,24888,24888,24888,24888,22436,23563,23563,23563,23563,23562,23562,23562,23562,23562,23562,23562,23562,23562,23547,23547,23547,23547,23547,23547,23547,22470,22474,22474,22474,22474,22474,22474,22474,22474,22474,22474,22474,22474,22474,22474,22474,22474,22474,22474,22474,22474,22474,22474,22474,22474,22474,22474,10440,10440,10440,10440,10440,10440,10440,10440,10440,10440,10440,10440,10440,10440,10440,10440,10440,10440,10440,10440,10440,10440,10440,10440,10440,10440,26217,26217,26217,26217,26217,26217,26217,26217,26217,26217,23470,23470,23470,23470,23470,23470,23470,23470,23470,25925,25925,25925,25925,25925,25925,25925,25925,25925,25925,25925,25925,25925,21978,21978,21978,21978,21978,21978,22404,21974,21974,21974,21974,25276,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,22449,25262,25262,25262,25395,25395,25395,25395,26809,26809,26809,26809,26809,26809,26809,26809,26809,26809,26809,26809,26809,26057,26057,26057,26057,26057,21981,21981,21981,21981,21981,21981,21981,21981,21981,21981,21981,21981,21981,21981,21981,21981,21981,21981,21982,21982,21982,24637,22090,22090,22090,24404,22458,22458,22458,22458,22458,22458,22458,22458,22458,22458,22458,22458,22458,22458,22458,22458,22458,26156,26156,16319,16319,16319,16319,16319,16319,16319,19716,25376,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,25422,25422,25422,25422,22551,22551,22551,22551,22551,22551,22551,22551,22551,22551,22551,22551,22551,22551,22551,22551,22551,22551,22551,26586,25315,21992,25132,25132,26347,21979,21979,21979,21979,21979,21979,21979,21917,26205,25605,25170,22464,22464,24950,24991,24992,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,23560,24578,24578,24578,24578,22240,22240,22240,22240,22240,24432,24432,24954,24954,24954,24954,22456,26252,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,22455,22461,22461,26076,22296,22296,22296,22296,22296,22296,22296,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,26035,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,21938,22411,22411,22411,22411,21944,24953,24953,24953,24953,24953,24953,24953,24953,24953,24953,24953,24953,24953,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,7936,22089,26078,26078,26078,26078,25230,25230,25230,21957,26500,22184,26815,26815,26815,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,26798,25129,25153,25153,25153,25153,25153,26202,26031,26031,26031,21967,21967,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,21899,25826,23354,22600,22600,22600,25609,25609,22188,22188,24888,23563,23563,22474,22474,22474,22474,22474,22474,26217,23470,23470,23470,23470,26688,26688,26688,25925,22449,22449,22449,22449,22449,22449,22449,22449,25395,21981,21981,21981,21981,22458,22458,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,21989,22551,22551,22551,22551,22551,25315)
            AND ma.category_id = 78
            AND ma.created_by = 339
            AND ma.currencies_id = 1
            AND ma.adjust_for_period_id = 229
            AND ma.apply_to_period_id = 229
            AND ma.parent_type = 'vendor'
            AND DATE(date_added) = '2018-02-22';;

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

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