<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<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 https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
    <changeSet author="Sheldan" id="activity-table">
        <createTable tableName="activity">
            <column autoIncrement="true" name="id" type="BIGINT">
                <constraints nullable="false" primaryKey="true" primaryKeyName="activity_pkey"/>
            </column>
            <column name="created" type="TIMESTAMP WITHOUT TIME ZONE">
                <constraints nullable="false"/>
            </column>
            <column name="type" type="VARCHAR(100)">
                <constraints nullable="false" />
            </column>
            <column name="template_key" type="VARCHAR(100)">
                <constraints nullable="false" />
            </column>
        </createTable>
        <sql>
            DROP TRIGGER IF EXISTS activity_insert_trigger ON activity;
            CREATE TRIGGER activity_insert_trigger BEFORE INSERT ON activity FOR EACH ROW EXECUTE PROCEDURE insert_trigger_procedure();
        </sql>
    </changeSet>
</databaseChangeLog>