<?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"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
         http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">

    <changeSet id="1" author="moxie">
        <createTable tableName="abusive_host_rules">
            <column name="id" type="bigint" autoIncrement="true">
                <constraints primaryKey="true" nullable="false"/>
            </column>

            <column name="host" type="inet">
                <constraints nullable="false" unique="true"/>
            </column>

            <column name="blocked" type="tinyint">
                <constraints nullable="false"/>
            </column>

            <column name="regions" type="text"/>
        </createTable>

        <createIndex tableName="abusive_host_rules" indexName="host_index">
            <column name="host"/>
        </createIndex>
    </changeSet>

    <changeSet id="2" author="moxie">
        <addColumn tableName="abusive_host_rules">
            <column name="notes" type="text"/>
        </addColumn>
    </changeSet>

</databaseChangeLog>
