2018-09-04 12:46:09 +00:00
..

$OpenBSD: README,v 1.2 2018/09/04 12:46:10 espie Exp $

+-----------------------------------------------------------------------
| Running ${PKGSTEM} on OpenBSD
+-----------------------------------------------------------------------

Overview
========

In order to use liquibase, you will need to install the JDBC
driver for the database containing the schema you wish to manage.
For example, to use liquibase to manage the schema of a PostgreSQL
database, you will need to install the postgresql-jdbc package or
port.

A simple example below shows two files, a script that contains the
liquibase command line necessary to run a migration on a PostgreSQL
database called 'foo'.  The liquibase XML changelog will add a new
table called 'department' to the database.

Example script
==============

#!/bin/sh
liquibase \
    --driver=org.postgresql.Driver \
    --classpath=${LOCALBASE}/share/postgresql/java/postgresql.jar \
    --changeLogFile=changes.xml \
    --url="jdbc:postgresql://localhost/foo" \
    --username=your_user \
    --password=your_password \
    migrate

Example ChangeLog File
======================

<?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-3.1.xsd">

    <changeSet id="1" author="bob">
        <createTable tableName="department">
            <column name="id" type="int">
                <constraints primaryKey="true" nullable="false"/>
            </column>
            <column name="name" type="varchar(50)">
                <constraints nullable="false"/>
            </column>
            <column name="active" type="boolean" defaultValueBoolean="true"/>
        </createTable>
    </changeSet>
</databaseChangeLog>