<?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="bhavinrshah">
        <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
            USE art_relations;;

            -- Added all active vendor_contract_id's to ROLLBACK-dms_carveouts table.
            CREATE TABLE `ROLLBACK-dms_carveouts`
            SELECT vendor_contract_id FROM vw_active_vendor_contract;;

            -- Insert into vendor_dms_master_restriction table for Soundcloud Go dms.
            INSERT IGNORE INTO vendor_dms_master_restriction (`customer_master_master_id`,`distribution_type_id`,`vendor_contract_id`,`last_updated`,`updated_by`) SELECT 677, 1, vendor_contract_id, NOW(), 562 FROM `ROLLBACK-dms_carveouts`;;
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
                USE art_relations;;

                DELETE FROM `vendor_dms_master_restriction` WHERE `customer_master_master_id` = 677 AND `distribution_type_id` = 1 AND `updated_by` = 562;;
            </sql>
        </rollback>
    </changeSet>
</databaseChangeLog>
