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

            CREATE TABLE project_log(
            project_id BIGINT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Primary key of project table',
            project_code varchar(255) NOT NULL COMMENT 'example: DAP-012',
            vendor_id INT(15) UNSIGNED NOT NULL COMMENT 'Vendor ID',
            subaccount_id INT(15) UNSIGNED COMMENT 'Subaccount ID',
            project_name varchar(255) NOT NULL,
            created_date_utc datetime(6) NOT NULL COMMENT 'microsecond precision',
            updated_date_utc datetime(6) NOT NULL COMMENT 'microsecond precision',
            correlation_id varchar(100) NOT NULL COMMENT 'example: e4eaaaf2-d142-11e1-b3e4-080027620cdd',
            log_date_utc datetime(6) NOT NULL COMMENT 'microsecond precision',
            log_action enum('insert','update','delete') DEFAULT NULL comment 'type of logging action',
            KEY `project_log_idx0` (`project_id`),
            KEY `project_log_idx1` (`log_date_utc`)
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8;;
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
                USE art_relations_log;;

                DROP TABLE project_log;;
            </sql>
        </rollback>
    </changeSet>
</databaseChangeLog>
