<?xml version="1.0" encoding="UTF-8"?>

<databaseChangeLog
        xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.3"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.3 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.3.xsd">
    <preConditions>
            <dbms type="mysql"/>
    </preConditions>

    <changeSet id="1" author="nvoxland">
        <createTable tableName="news">
            <column name="id" type="int" autoIncrement="true">
                <constraints primaryKey="true" nullable="false"/>
            </column>
            <column name="title" type="varchar(50)"/>
        </createTable>
    </changeSet>

    <changeSet id="2" author="nvoxland" context="test">
        <insert tableName="news">
            <column name="title" value="Liquibase 0.8 Released"/>
        </insert>
        <insert tableName="news">
            <column name="title" value="Liquibase 0.9 Released"/>
        </insert>
        <rollback>
            delete from news where title='Liquibase 0.9 Released' OR title='Liquibase 0.8 Released'
        </rollback>
    </changeSet>

    <changeSet id="3" author="nvoxland" context="demo">
        <insert tableName="news">
            <column name="title" value="Liquibase 1.0 Released"/>
        </insert>
        <rollback>
            delete from news where title='Liquibase 1.0 Released'
        </rollback>
    </changeSet>
</databaseChangeLog>