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

            UPDATE distribution_format
                SET distribution_format_media_format_id = NULL
            WHERE distribution_format_id = 91;;
            
            DELETE FROM distribution_format WHERE distribution_format_id IN (92, 93);;
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
                USE art_relations;;

                UPDATE distribution_format
                    SET distribution_format_media_format_id = 3
                WHERE distribution_format_id = 91;;
                
                INSERT INTO distribution_format(
                    distribution_format_id,
                    distribution_format_media_id,
                    distribution_format_media_format_id,
                    display_flag,
                    context_type
                ) VALUES
                    (92, 12, 1, 'Y', 'physical'),
                    (93, 12, 2, 'Y', 'physical');;
            </sql>
         </rollback>
    </changeSet>
</databaseChangeLog>
