<?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="vghadi">
        <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
                    ('2015-08-25 11:12:15', '261', '64', '1726294', -4000.000000, '1', "Crocodile Gennadiy - Dan O'Meara, grassroots outreach services", '227662'),
                    ('2016-12-23 09:50:10', '261', '61', '1712205', -570.000000, '1', 'Lamb - Hollywood Software', '294835'),
                    ('2016-10-23 12:24:47', '261', '59', '1779270', 5100.000000, '1', 'Southbound - Kasima', '287454'),
                    ('2016-12-23 09:50:11', '261', '61', '1779270', -570.000000, '1', 'Southbound - Hollywood Software', '294840'),
                    ('2016-06-23 16:12:08', '261', '59', '1816734', -1170.410000, '1', 'Demon - Deluxe Entertainment', '274843'),
                    ('2016-05-23 12:34:32', '261', '60', '1860094', -3000.000000, '1', 'Christine - MPAA rating', '274249'),
                    ('2016-06-23 16:12:08', '261', '59', '1856301', -2000.000000, '1', 'Ghost Team - Philadelphia Film Society, 4 wall rental', '274849'),
                    ('2016-09-26 13:25:24', '261', '59', '1867440', -2500.000000, '1', 'Miss Stevens - Cinema Village Cinemart, 4 wall', '285769');;

                UPDATE manual_adjustment
                    SET category_id = '65', `comment` = 'Expenses (1)'
                    WHERE id IN (227662, 294835, 287454, 294840, 274843, 274249, 274849, 285769);;
            ]]>
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
                <![CDATA[
                    DELETE FROM release_manual_adjustment WHERE vendor_manual_adjustment_id IN (227662, 294835, 287454, 294840, 274843, 274249, 274849, 285769);;

                    UPDATE manual_adjustment
                        SET category_id = '64', `comment` = "Crocodile Gennadiy - Dan O'Meara, grassroots outreach services", updated_timestamp = '2015-09-28 11:18:30'
                        WHERE id = 227662;;

                    UPDATE manual_adjustment 
                        SET category_id = '61', `comment` = 'Lamb - Hollywood Software', updated_timestamp = '2016-12-23 9:50:10'
                        WHERE id = 294835;;

                    UPDATE manual_adjustment
                        SET category_id = '59', `comment` = 'Southbound - Kasima', updated_timestamp = '2016-10-23 12:24:47'
                        WHERE id = 287454;;

                    UPDATE manual_adjustment 
                        SET category_id = '61', `comment` = 'Southbound - Hollywood Software', updated_timestamp = '2016-12-23 9:50:11'
                        WHERE id = 294840;;

                    UPDATE manual_adjustment
                        SET category_id = '59', `comment` = 'Demon - Deluxe Entertainment', updated_timestamp = '2016-06-23 16:12:08'
                        WHERE id = 274843;;

                    UPDATE manual_adjustment
                        SET category_id = '60', `comment` = 'Christine - MPAA rating', updated_timestamp = '2016-05-23 12:34:32'
                        WHERE id = 274249;;

                    UPDATE manual_adjustment
                        SET category_id = '59', `comment` = 'Ghost Team - Philadelphia Film Society, 4 wall rental', updated_timestamp = '2016-06-23 16:12:08'
                        WHERE id = 274849;;

                    UPDATE manual_adjustment
                        SET category_id = '59', `comment` = 'Miss Stevens - Cinema Village Cinemart, 4 wall', updated_timestamp = '2016-09-26 13:25:24'
                        WHERE id = 285769;;
                ]]>
            </sql>
        </rollback>
    </changeSet>
</databaseChangeLog>
