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

            ALTER TABLE catalog_library 
            CHANGE COLUMN `manufacturer_upc` `upc` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'UPC of releases table.',
            MODIFY genre VARCHAR(15) COMMENT 'Genre name.',
            MODIFY sub_genere VARCHAR(80) COMMENT 'Subgenre name.',
            DROP COLUMN orchard_upc,
            ADD COLUMN orchard_compilation_authorization_required ENUM('Y','N') DEFAULT 'N' COMMENT 'Indicates whether Authorization Required for Orchard Compilation.';;

        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">

                USE compilations;;

                ALTER TABLE catalog_library 
                CHANGE COLUMN `upc` `manufacturer_upc` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'UPC of releases table.',
                MODIFY genre VARCHAR(15) NOT NULL COMMENT 'Genre name.',
                MODIFY sub_genere VARCHAR(80) NOT NULL COMMENT 'Subgenre name.',
                ADD COLUMN orchard_upc bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Orchard (Cross-Label) UPC.',
                DROP COLUMN orchard_compilation_authorization_required ;;

            </sql>
        </rollback>
    </changeSet>
</databaseChangeLog>
