<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
                   xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
                   xmlns:pro="http://www.liquibase.org/xml/ns/pro"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
    http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
    http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
    <changeSet author="Sheldan" id="counters-table">
        <createTable tableName="counter">
            <column autoIncrement="true" name="counter" type="BIGINT">
                <constraints nullable="false"/>
            </column>
            <column name="server_id" type="BIGINT">
                <constraints nullable="false"/>
            </column>
            <column name="counter_key" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
        </createTable>
        <addPrimaryKey
                columnNames="counter_key, server_id"
                constraintName="pk_counter"
                tableName="counter"/>
        <addForeignKeyConstraint baseColumnNames="server_id" baseTableName="counter" constraintName="fk_counter_server" deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="id" referencedTableName="server" validate="true"/>

    </changeSet>
</databaseChangeLog>