<?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="smachado">
        <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
            <![CDATA[
                INSERT INTO release_manual_adjustment
                    (date_created, created_by, category_id, release_id, amount, currencies_id, description, vendor_manual_adjustment_id)
                VALUES
                    ('2016-11-28 22:59:11', '261', '59', '1649922', -130.000000, '1', 'Cartel Land - Co-Evolution', '293264');;

                UPDATE manual_adjustment 
                    SET amount = -180.000000, amount_in_original_currency = -180.000000, `comment` = 'Expenses (2)'
                WHERE id = 293264;;

                DELETE FROM manual_adjustment WHERE id IN (293265);;
            ]]>
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
                <![CDATA[
                    DELETE FROM release_manual_adjustment WHERE vendor_manual_adjustment_id = 293264 AND amount = -130.000000;;

                    UPDATE manual_adjustment 
                        SET amount = -50.000000, amount_in_original_currency = -50.000000, `comment` = 'Expenses (1)', updated_timestamp = '2016-11-28 22:59:11'
                    WHERE id = 293264;;

                    INSERT INTO manual_adjustment
                        (id, parent_type, parent_id, date_added, created_by, amount, `comment`, category_id, adjust_for_period_id, apply_to_period_id, currencies_id, amount_in_original_currency, updated_timestamp)
                    VALUES
                        ('293265', 'vendor', '24905', '2016-11-28 22:59:11', '261', -130.000000, 'Cartel Land - Co-Evolution', '59', '214', '214', '1', -130.000000, '2016-11-28 22:59:11');;
                ]]>
            </sql>
        </rollback>
    </changeSet>
    <changeSet id="2" author="smachado">
        <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
            <![CDATA[
                INSERT INTO release_manual_adjustment
                    (date_created, created_by, category_id, release_id, amount, currencies_id, description, vendor_manual_adjustment_id)
                VALUES
                    ('2016-12-23 09:50:10', '261', '61', '1726294', -190.000000, '1', 'Almost Holy - Hollywood Software', '294831'),
                    ('2016-12-23 09:50:10', '261', '61', '1726294', -4300.000000, '1', 'Almost Holy - Metal Rabbit Media, digital and social media', '294831'),
                    ('2016-12-23 09:50:10', '261', '61', '1726294', -100.000000, '1', 'Almost Holy - Metal Rabbit Media, digital and social media', '294831');;

                UPDATE manual_adjustment 
                    SET amount = -4740.000000, amount_in_original_currency = -4740.000000, `comment` = 'Expenses (4)'
                WHERE id = 294831;;

                DELETE FROM manual_adjustment WHERE id IN (294828, 294829, 294830);;
            ]]>
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
                <![CDATA[
                    DELETE FROM release_manual_adjustment WHERE vendor_manual_adjustment_id = 294831 AND amount IN (-190.000000, -4300.000000, -100.000000);;

                    UPDATE manual_adjustment 
                        SET amount = -150.000000, amount_in_original_currency = -150.000000, `comment` = 'Expenses (1)', updated_timestamp = '2016-12-23 09:50:10'
                    WHERE id = 294831;;

                    INSERT INTO manual_adjustment
                        (id, parent_type, parent_id, date_added, created_by, amount, `comment`, category_id, adjust_for_period_id, apply_to_period_id, currencies_id, amount_in_original_currency, updated_timestamp)
                    VALUES
                        ('294828', 'vendor', '25038', '2016-12-23 09:50:10', '261', -190.000000, 'Almost Holy - Hollywood Software', '61', '215', '215', '1', -190.000000, '2016-12-23 09:50:10'),
                        ('294829', 'vendor', '25038', '2016-12-23 09:50:10', '261', -4300.000000, 'Almost Holy - Metal Rabbit Media, digital and social media', '61', '215', '215', '1', -4300.000000, '2016-12-23 09:50:10'),
                        ('294830', 'vendor', '25038', '2016-12-23 09:50:10', '261', -100.000000, 'Almost Holy - Metal Rabbit Media, digital and social media', '61', '215', '215', '1', -100.000000, '2016-12-23 09:50:10');;
                ]]>
            </sql>
        </rollback>
    </changeSet>
    <changeSet id="3" author="smachado">
        <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
            <![CDATA[
                INSERT INTO release_manual_adjustment
                    (date_created, created_by, category_id, release_id, amount, currencies_id, description, vendor_manual_adjustment_id)
                VALUES
                    ('2016-12-23 09:50:10', '261', '61', '1686643', -1430.000000, '1', 'Louder Than Bombs - Hollywood Software', '294833');;

                UPDATE manual_adjustment 
                    SET amount = -1662.500000, amount_in_original_currency = -1662.500000, `comment` = 'Expenses (5)'
                WHERE id = 294833;;

                DELETE FROM manual_adjustment WHERE id IN (294832);;
            ]]>
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
                <![CDATA[
                    DELETE FROM release_manual_adjustment WHERE vendor_manual_adjustment_id = 294833 AND amount = -1430.000000;;

                    UPDATE manual_adjustment 
                        SET amount = -232.500000, amount_in_original_currency = -232.500000, `comment` = 'Expenses (4)', updated_timestamp = '2016-12-23 09:50:10'
                    WHERE id = 294833;;

                    INSERT INTO manual_adjustment
                        (id, parent_type, parent_id, date_added, created_by, amount, `comment`, category_id, adjust_for_period_id, apply_to_period_id, currencies_id, amount_in_original_currency, updated_timestamp)
                    VALUES
                        ('294832', 'vendor', '25040', '2016-12-23 09:50:10', '261', -1430.000000, 'Louder Than Bombs - Hollywood Software', '61', '215', '215', '1', -1430.000000, '2016-12-23 09:50:10');;
                ]]>
            </sql>
        </rollback>
    </changeSet>
    <changeSet id="4" author="smachado">
        <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
            <![CDATA[
                INSERT INTO release_manual_adjustment
                    (date_created, created_by, category_id, release_id, amount, currencies_id, description, vendor_manual_adjustment_id) 
                VALUES
                    ('2016-10-23 12:24:47', '261', '59', '1816734', -7500.000000, '1', 'Demon - Landmark Theatrs, calendar fees', '287465');;

                UPDATE manual_adjustment
                    SET amount = -22153.420000, `comment` = 'Expenses (22)', amount_in_original_currency = -22153.420000
                    WHERE id = 287465;;

                DELETE FROM manual_adjustment WHERE id = 287464;;
            ]]>
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
                <![CDATA[
                    DELETE FROM release_manual_adjustment WHERE vendor_manual_adjustment_id = 287465 AND amount = -7500.000000;;

                    UPDATE manual_adjustment
                        SET amount = -14653.420000, `comment` = 'Expenses (21)', amount_in_original_currency = -14653.420000, updated_timestamp = '2016-10-23 12:24:47'
                        WHERE id = 287465;;

                    INSERT INTO manual_adjustment
                        (id, parent_type, parent_id, date_added, created_by, amount, `comment`, category_id, adjust_for_period_id, apply_to_period_id, currencies_id, amount_in_original_currency, updated_timestamp)
                    VALUES
                        ('287464', 'vendor', '25349', '2016-10-23 12:24:47', '261', -7500.000000, 'Demon - Landmark Theatrs, calendar fees', '59', '213', '213', '1', -7500.000000, '2016-10-23 12:24:47');;       
                ]]>
            </sql>
        </rollback>
    </changeSet>
    <changeSet id="5" author="smachado">
        <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
            <![CDATA[
                INSERT INTO release_manual_adjustment
                    (date_created, created_by, category_id, release_id, amount, currencies_id, description, vendor_manual_adjustment_id) 
                VALUES
                    ('2016-10-23 12:24:48', '261', '62', '1867440', -4940.900000, '1', 'Miss Stevens - S. Callan Advertising, newspaper', '287479');;

                UPDATE manual_adjustment
                    SET amount = -7741.750000, `comment` = 'Expenses (12)', amount_in_original_currency = -7741.750000
                    WHERE id = 287479;;

                DELETE FROM manual_adjustment WHERE id = 287480;;
            ]]>
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
                <![CDATA[
                    DELETE FROM release_manual_adjustment WHERE vendor_manual_adjustment_id = 287479 AND amount = -4940.900000;;

                    UPDATE manual_adjustment
                        SET amount = -2800.850000, `comment` = 'Expenses (11)', amount_in_original_currency = -2800.850000, updated_timestamp = '2016-10-23 12:24:48'
                        WHERE id = 287479;;

                    INSERT INTO manual_adjustment
                        (id, parent_type, parent_id, date_added, created_by, amount, `comment`, category_id, adjust_for_period_id, apply_to_period_id, currencies_id, amount_in_original_currency, updated_timestamp)
                    VALUES
                        ('287480', 'vendor', '25460', '2016-10-23 12:24:48', '261', -4940.900000, 'Miss Stevens - S. Callan Advertising, newspaper', '62', '213', '213', '1', -4940.900000, '2016-10-23 12:24:48');;
                ]]>
            </sql>
        </rollback>
    </changeSet>
    <changeSet id="6" author="smachado">
        <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
            <![CDATA[
                INSERT INTO release_manual_adjustment
                    (date_created, created_by, category_id, release_id, amount, currencies_id, description, vendor_manual_adjustment_id) 
                VALUES
                    ('2016-10-23 12:24:48', '261', '61', '1896226', -25000.000000, '1', 'Neruda - Mark Woollen & Associates, trailer', '287482');;

                UPDATE manual_adjustment
                    SET amount = -40564.330000, `comment` = 'Expenses (33)', amount_in_original_currency = -40564.330000
                    WHERE id = 287482;;

                DELETE FROM manual_adjustment WHERE id = 287481;;
            ]]>
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
                <![CDATA[
                    DELETE FROM release_manual_adjustment WHERE vendor_manual_adjustment_id = 287482 AND amount = -25000.000000;;

                    UPDATE manual_adjustment
                        SET amount = -15564.330000, `comment` = 'Expenses (32)', amount_in_original_currency = -15564.330000, updated_timestamp = '2016-10-23 12:28:37'
                        WHERE id = 287482;;

                    INSERT INTO manual_adjustment
                        (id, parent_type, parent_id, date_added, created_by, amount, `comment`, category_id, adjust_for_period_id, apply_to_period_id, currencies_id, amount_in_original_currency, updated_timestamp)
                    VALUES
                        ('287481', 'vendor', '25462', '2016-10-23 12:24:48', '261', -25000.000000, 'Neruda - Mark Woollen & Associates, trailer', '61', '213', '213', '1', -25000.000000, '2016-10-23 12:24:48');;    
                ]]>
            </sql>
        </rollback>
    </changeSet>
    <changeSet id="7" author="smachado">
        <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
            <![CDATA[
                INSERT INTO release_manual_adjustment
                    (date_created, created_by, category_id, release_id, amount, currencies_id, description, vendor_manual_adjustment_id) 
                VALUES
                    ('2016-10-23 12:24:48', '261', '59', '1880982', -9250.000000, '1', 'Blue Jay - Village East Cinemas, 4 wall', '287486');;
                
                UPDATE manual_adjustment
                    SET amount = -21342.350000, `comment` = 'Expenses (8)', amount_in_original_currency = -21342.350000
                    WHERE id = 287486;;

                DELETE FROM manual_adjustment WHERE id = 287487;;
            ]]>
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
                <![CDATA[
                    DELETE FROM release_manual_adjustment WHERE vendor_manual_adjustment_id = 287486 AND amount = -9250.000000;;

                    UPDATE manual_adjustment
                        SET amount = -12092.350000, `comment` = 'Expenses (7)', amount_in_original_currency = -12092.350000, updated_timestamp = '2016-10-23 12:24:48'
                        WHERE id = 287486;;

                    INSERT INTO manual_adjustment
                        (id, parent_type, parent_id, date_added, created_by, amount, `comment`, category_id, adjust_for_period_id, apply_to_period_id, currencies_id, amount_in_original_currency, updated_timestamp)
                    VALUES 
                        ('287487', 'vendor', '25507', '2016-10-23 12:24:48', '261', -9250.000000, 'Blue Jay - Village East Cinemas, 4 wall', '59', '213', '213', '1', -9250.000000, '2016-10-23 12:24:48');;
                ]]>
            </sql>
        </rollback>
    </changeSet>
</databaseChangeLog>
