<?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 royalty_collections;;

            DROP TABLE IF EXISTS `ppl_track_query_criteria`;;

            CREATE TABLE `ppl_track_query_criteria` (
              `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
              `filename` VARCHAR(255) NOT NULL,
              `exclude_deleted` ENUM('Y','N') NOT NULL DEFAULT 'Y' COMMENT 'whether to exclude deleted releases info or not',
              `start_time` DATETIME DEFAULT CURRENT_TIMESTAMP,
              `end_time` DATETIME DEFAULT NULL,
              `requested_by` INT(11) NOT NULL,
              `number_of_rows` INT(11) DEFAULT NULL,
              PRIMARY KEY (`id`)
            ) ENGINE=INNODB DEFAULT CHARSET=utf8;;

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

                USE royalty_collections;;

                DROP TABLE IF EXISTS `ppl_track_query_criteria`;;

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