<?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="n-kumar">
        <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">

        <!--Insert new encoding profile for Library Ideas trailer-->
            INSERT INTO encoding_profile (profile_type, description, format) VALUES ('trailer', 'Library Ideas Trailer', 'mov');;
            SET @last_id_in_encoding_profile_trailer = LAST_INSERT_ID();;

            INSERT INTO video_encoding_profile(encoding_profile_id, description, format, aspect_ratio, resolution, video_source, extension, encoding_engine, fps)
            (SELECT @last_id_in_encoding_profile_trailer, 'Library Ideas Trailer', format, aspect_ratio, resolution, video_source, extension, encoding_engine, fps FROM video_encoding_profile
            WHERE encoding_profile_id = 316);;
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
            <!--rollback for Library Ideas trailer-->
                DELETE FROM video_encoding_profile WHERE description = "Library Ideas Trailer";;
                DELETE FROM encoding_profile WHERE profile_type = "trailer" AND description = "Library Ideas Trailer";;
            </sql>
        </rollback>
    </changeSet>
</databaseChangeLog>
