<?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="101" author="jian">
        <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
        <![CDATA[
            USE direct_delivery;;
            
            DROP EVENT IF EXISTS ev_renew_lost_delivery_queue_items;;
            
            CREATE DEFINER = 'theorchard_dd'@'127.0.0.1' EVENT ev_renew_lost_delivery_queue_items
            ON SCHEDULE EVERY 30 MINUTE STARTS '2014-12-04 13:36:38' 
            ON COMPLETION NOT PRESERVE 
            DISABLE ON SLAVE 
            DO 
            BEGIN 
                CALL sp_renew_lost_delivery_queue_items(); 
            END;;
        ]]>
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
            <![CDATA[
                USE direct_delivery;;

                DROP EVENT IF EXISTS ev_renew_lost_delivery_queue_items;;
                
                CREATE DEFINER='theorchard_dd'@'127.0.0.1' EVENT ev_renew_lost_delivery_queue_items
                ON SCHEDULE EVERY 1 DAY STARTS '2014-06-20 02:00:00' 
                ON COMPLETION NOT PRESERVE ENABLE 
                DO 
                BEGIN
                    CALL sp_renew_lost_delivery_queue_items();
                END;;
            ]]>
            </sql>
        </rollback>
    </changeSet>
</databaseChangeLog>
