liquibase
manage SQL database schemas via config files
WWW CVSWeb GITHub-
Package versionliquibase-3.5.1p2
-
MaintainerBryan Everly
Liquibase is a Java-based command-line tool that allows you to build and
maintain a SQL database schema using a series of "changeset" files that
can be checked into a version control system. This allows the database
schema to be just another piece of your application that can be
versioned and maintained, just like any other piece of source code.
+-----------------------------------------------------------------------
| 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>
- java/javaPathHelper
- jdk->=1.8v0,<1.9v0:devel/jdk/1.8