<?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="101-2" author="jian">
        <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
        <![CDATA[
            DROP PROCEDURE IF EXISTS sp_get_dms_encoding_specs;;

            CREATE DEFINER='theorchard_dd'@'127.0.0.1' PROCEDURE sp_get_dms_encoding_specs(dmm_id INT, prod_type_id INT)
            BEGIN 
                SELECT ep.encoding_profile_id, ep.profile_type, ep.description, ep.batch_url, ep.url, ep.options, ep.format, ep.url_host, ep.xml_version,
                    dep.order_type, dep.filename, dep.id3_tag, dep.required, dep.delivery_location, dep.hashcode, dep.filesize, dep.width, dep.height, 
                    dep.clip_length, dep.filesize_limit, dep.frequency, dep.channel, dep.bitrate, dep.stored_location, dep.extension, dep.product_type_id, 
                    dep.video_image_cat_id, dep.vantrix_profile_id, dep.vantrix_profile_type
                FROM dms_encoding_profile dep	
                INNER JOIN encoding_profile ep ON ep.encoding_profile_id = dep.encoding_profile_id 
                WHERE dep.dms_master_master_id = dmm_id AND dep.product_type_id = prod_type_id; 
            END;;
        ]]>
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
            <![CDATA[
                DROP PROCEDURE IF EXISTS sp_get_dms_encoding_specs;;

                CREATE DEFINER='theorchard_dd'@'127.0.0.1' PROCEDURE sp_get_dms_encoding_specs(dmm_id INT, prod_type_id INT)
                BEGIN 
                    SELECT ep.encoding_profile_id, ep.profile_type, ep.description, ep.batch_url, ep.url, ep.options, ep.format, ep.url_host,
                        dep.order_type, dep.filename, dep.id3_tag, dep.required, dep.delivery_location, dep.hashcode, dep.filesize, dep.width, dep.height,
                        dep.clip_length, dep.filesize_limit, dep.frequency, dep.channel, dep.bitrate, dep.stored_location, dep.extension, dep.product_type_id,
                        dep.video_image_cat_id, dep.vantrix_profile_id, dep.vantrix_profile_type
                    FROM dms_encoding_profile dep
                    INNER JOIN encoding_profile ep ON ep.encoding_profile_id = dep.encoding_profile_id
                    WHERE dep.dms_master_master_id = dmm_id AND dep.product_type_id = prod_type_id;
                END;;
            ]]>
            </sql>
        </rollback>
    </changeSet>
</databaseChangeLog>
