<?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="azinger">
        <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
            <![CDATA[
                INSERT INTO red_essential_label_mapping
                (vendor_id, company_name, red_essential_label_code, red_essential_label_name)
                SELECT m.vendor_id, v.company, m.red_essential_label_code, m.red_essential_label_name
                FROM (
                  SELECT 8129 AS vendor_id, 'E455' AS red_essential_label_code, 'Rude Records' AS red_essential_label_name
                  UNION ALL SELECT 23437 AS vendor_id, 'E456' AS red_essential_label_code, 'CYHSY, Inc' AS red_essential_label_name
                  UNION ALL SELECT 20651 AS vendor_id, 'E457' AS red_essential_label_code, 'Mello Music Group' AS red_essential_label_name
                  UNION ALL SELECT 12530 AS vendor_id, 'E458' AS red_essential_label_code, 'Ernest Jennings' AS red_essential_label_name
                  UNION ALL SELECT 24895 AS vendor_id, 'E459' AS red_essential_label_code, 'Rhyme & Reason' AS red_essential_label_name
                  UNION ALL SELECT 21123 AS vendor_id, 'E460' AS red_essential_label_code, 'Blue Corn' AS red_essential_label_name
                  UNION ALL SELECT 14686 AS vendor_id, 'E461' AS red_essential_label_code, 'Raveonettes' AS red_essential_label_name
                  UNION ALL SELECT 15906 AS vendor_id, 'E462' AS red_essential_label_code, 'Basick Records' AS red_essential_label_name
                ) AS m
                JOIN vendor AS v USING (vendor_id)
                ;;
            ]]>
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
                <![CDATA[
                    DELETE FROM red_essential_label_mapping
                    WHERE vendor_id IN (
                        8129, 
                        23437,
                        20651,
                        12530,
                        24895,
                        21123,
                        14686,
                        15906
                    )
                    ;;
                ]]>
            </sql>
        </rollback>
    </changeSet>
</databaseChangeLog>
