<?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[
            DROP TABLE IF EXISTS aspera_cloud_storage_spec;;
            
            CREATE TABLE aspera_cloud_storage_spec (
              dms_delivery_spec_id INT(11) NOT NULL COMMENT 'Primary Key and FK to dms_delivery_spec.',
              domain_name VARCHAR(150) DEFAULT NULL COMMENT 'The domain name of the remote server.',
              user_name VARCHAR(100) DEFAULT NULL COMMENT 'Username of the authentication required by the server.',
              password VARCHAR(100) DEFAULT NULL COMMENT 'Password of the authentication required by the server.',
              udp_port INT UNSIGNED COMMENT 'The port number of the server.',
              protocol ENUM('azu', 's3') COMMENT 'Cloud storage protocols',
              PRIMARY KEY (dms_delivery_spec_id)
            ) ENGINE=INNODB;;

            ALTER TABLE dms_delivery_spec
            CHANGE connection_type connection_type ENUM('ftp','sftp','itp','aspera','local','aspera_cloud');;
          ]]>
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
            <![CDATA[
                DROP TABLE IF EXISTS aspera_cloud_storage_spec;;
                
                ALTER TABLE dms_delivery_spec
                CHANGE connection_type connection_type ENUM('ftp','sftp','itp','aspera','local');;
            ]]>
            </sql>
        </rollback>
    </changeSet>
</databaseChangeLog>
