Introducing LiquiBase to existing project.
.. -*- coding: utf-8; -*-
.. include:: HEADER.rst
============
LiquiBase.
============
.. contents::
Introducing LiquiBase to existing project.
==========================================
Official statement about introducing LiquiBase to existing project are:
http://www.liquibase.org/documentation/existing_project.html
Adding Liquibase on an Existing project
There are two approaches:
* create full schema definition prior to introducing Liquibase
* works only with current changes becase Liquibase basically work only with changesets and only
special supplied instruments care about full schema definition
To create full schema debinition you may run::
mvn liquibase:generateChangeLog -Dliquibase.outputChangeLogFile=...
on clean project without Liquibase. Or set name for changelog output file in ``pom.xml``.
(here reduced not fully worked declaration)::
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>${liquibase.version}</version>
<configuration>
<outputChangeLogFile>changelog.xml</outputChangeLogFile>
</configuration>
</plugin>
.. NOTE::
``pom.xml`` settings have precedence over ``-Dliquibase.outputChangeLogFile=...`` unless you
define it as::
<properties>
<liquibase.outputChangeLogFile>${project.build.directory}/changelog.xml</liquibase.outputChangeLogFile>
</properties>
<plugins>
<plugin>
<configuration>
<outputChangeLogFile>${liquibase.outputChangeLogFile}</outputChangeLogFile>
</configuration>
</plugin>
</plugins>