<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
    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.5.xsd
                        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">

    <property name="now" value="now()" dbms="h2"/>

    <property name="now" value="now()" dbms="mysql"/>
    <property name="autoIncrement" value="true"/>

    <property name="floatType" value="float4" dbms="postgresql, h2"/>
    <property name="floatType" value="float" dbms="mysql, oracle, mssql"/>

    <!--
        Added the entity TBNotification.
    -->
    <changeSet id="20200825093630-1" author="jhipster">
        <createTable tableName="tb_notification">
            <column name="id" type="bigint" autoIncrement="${autoIncrement}">
                <constraints primaryKey="true" nullable="false"/>
            </column>
            <column name="channel" type="varchar(255)">
                <constraints nullable="true" />
            </column>

            <column name="send_from" type="bigint">
                <constraints nullable="true" />
            </column>

            <column name="send_to" type="bigint">
                <constraints nullable="true" />
            </column>

            <column name="subject" type="varchar(255)">
                <constraints nullable="true" />
            </column>

            <column name="message" type="varchar(255)">
                <constraints nullable="true" />
            </column>

            <column name="status" type="varchar(255)">
                <constraints nullable="true" />
            </column>

            <column name="tb_crop_id" type="bigint">
                <constraints nullable="true" />
            </column>

            <column name="tb_entity_id" type="bigint">
                <constraints nullable="true" />
            </column>

            <column name="click_action" type="varchar(255)">
                <constraints nullable="true" />
            </column>

            <column name="jhi_contents" type="varchar(255)">
                <constraints nullable="true" />
            </column>

            <column name="created_date" type="datetime">
                <constraints nullable="true" />
            </column>

            <column name="send_date" type="datetime">
                <constraints nullable="true" />
            </column>

            <column name="is_read" type="integer">
                <constraints nullable="true" />
            </column>

            <column name="is_test_message" type="integer">
                <constraints nullable="true" />
            </column>

            <column name="jhi_type" type="varchar(255)">
                <constraints nullable="true" />
            </column>

            <column name="external_id" type="bigint">
                <constraints nullable="true" />
            </column>

            <!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->
        </createTable>
        <dropDefaultValue tableName="tb_notification" columnName="created_date" columnDataType="datetime"/>
        <dropDefaultValue tableName="tb_notification" columnName="send_date" columnDataType="datetime"/>
        
    </changeSet>
    <!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here, do not remove-->
</databaseChangeLog>
