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

            CREATE TABLE mkt_program_info_log(
            mkt_program_info_id int(10) UNSIGNED NOT NULL,
            mkt_program_id int(11) NOT NULL,
            info_for varchar(12),
            info_for_id bigint(20) NOT NULL,
            subject varchar(255) DEFAULT NULL COMMENT 'Subject of the marketing program info.',
            description text COMMENT 'Descriptive text for this marketing program info.',
            attachment varchar(12) NOT NULL,
            date_added datetime DEFAULT NULL COMMENT 'Date this marketing program info is added.',
            last_updated datetime DEFAULT NULL COMMENT 'Date this entry is last updated.',
            scope varchar(12),
            client varchar(12) COMMENT 'Describes whether records added/updated from oa or alw',
            log_date_utc datetime(6) NOT NULL COMMENT 'microsecond precision',
            log_action enum('insert','update','delete') DEFAULT NULL comment 'type of logging action',
            KEY `mkt_program_info_id` (`mkt_program_info_id`),
            KEY `mkt_program_id` (`mkt_program_id`),
            KEY `info_for_id` (`info_for_id`),
            KEY `info_for` (`info_for`)
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='audit log for mkt_program_info table';;
        </sql>
        <rollback>
            <sql dbms="mysql" endDelimiter=";;" splitStatements="true" stripComments="true">
                USE art_relations_log;;

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