<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
            http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">

    <property name="cmUserIdLength" value="1024" dbms="postgresql,oracle"/>
    <property name="cmUserIdLength" value="255" dbms="mysql,mssql"/>

    <changeSet id="01-create-outlook-table" author="sasko.tanaskoski">
        <createTable tableName="acm_outlook_password">
            <column name="cm_user_id" type="VARCHAR(${cmUserIdLength})">
                <constraints nullable="false"/>
            </column>
            <column name="cm_outlook_password" type="VARCHAR(1024)"/>
        </createTable>
    </changeSet>
    <changeSet id="02-create-outlook-folder-tables" author="lazo.lazarev">
        <createTable tableName="acm_outlook_folder_creator">
            <column name="cm_outlook_folder_creator_id" type="${idType}">
                <constraints primaryKeyName="pk_acm_outlook_folder_creator" primaryKey="true"/>
            </column>
            <column name="cm_system_email_address" type="VARCHAR(256)">
                <constraints nullable="false"/>
            </column>
            <column name="cm_system_password" type="VARCHAR(1024)">
                <constraints nullable="false"/>
            </column>
        </createTable>
        <createTable tableName="acm_outlook_folder_creator_id">
            <column name="cm_seq_num" type="${idType}"/>
            <column name="cm_seq_name" type="VARCHAR(255)"/>
        </createTable>
        <insert tableName="acm_outlook_folder_creator_id">
            <column name="cm_seq_num" value="100"/>
            <column name="cm_seq_name" value="acm_outlook_folder_creator"/>
        </insert>
        <createTable tableName="acm_outlook_object_reference">
            <column name="cm_outlook_object_reference_id" type="${idType}">
                <constraints primaryKeyName="pk_acm_outlook_object_reference" primaryKey="true"/>
            </column>
            <column name="cm_object_type" type="VARCHAR(128)">
                <constraints nullable="false"/>
            </column>
            <column name="cm_object_id" type="${idType}">
                <constraints nullable="false"/>
            </column>
            <column name="cm_outlook_folder_creator_id" type="${idType}">
                <constraints nullable="false"/>
            </column>
        </createTable>
        <createTable tableName="acm_outlook_object_reference_id">
            <column name="cm_seq_num" type="${idType}"/>
            <column name="cm_seq_name" type="VARCHAR(255)"/>
        </createTable>
        <insert tableName="acm_outlook_object_reference_id">
            <column name="cm_seq_num" value="100"/>
            <column name="cm_seq_name" value="acm_outlook_object_reference"/>
        </insert>
    </changeSet>

</databaseChangeLog>
