<?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="mmore">
        <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
            INSERT INTO encoding_profile (profile_type, description, format) VALUES ('video', 'Clean 4K / UHD', 'mov');;

            SET @newEncodingProfileId = LAST_INSERT_ID();;

            INSERT INTO video_encoding_profile(encoding_profile_id, description, format, aspect_ratio, resolution, video_source, extension, encoding_engine, fps)
            (SELECT @newEncodingProfileId, 'Clean 4K / UHD', format, aspect_ratio, resolution, '353', extension, encoding_engine, fps FROM video_encoding_profile WHERE encoding_profile_id = 351);;
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
                DELETE FROM video_encoding_profile WHERE video_source IN (353) AND description = 'Clean 4K / UHD';;

                DELETE FROM encoding_profile WHERE profile_type = 'video' AND description = 'Clean 4K / UHD' AND format = 'mov';;
            </sql>
        </rollback>
    </changeSet>
</databaseChangeLog>
