Академический Документы
Профессиональный Документы
Культура Документы
http://www.liquibase.org/
Installation
Download Liquibase from http://www.liquibase.org/download and extract the archive file.
Usage
You can run from the command line with liquibase or liquibase.bat in the extracted folder, or simply run java -jar liquibase.jar.
liquibase.properties
When running from the command line, you can put the required properties in ./liquibase.properties . Below is an example:
#liquibase.properties
driver: oracle.jdbc.OracleDriver
classpath: jdbcdriver.jar
url: jdbc:oracle:thin:@localhost:1521:oracle
username: scott
password: tiger
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>2.0.1</version>
</dependency>
Setup below in the setting of Spring and it will automatically execute update when you initial Spring context.
<build>
<plugins>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>2.0.1</version>
<configuration>
<propertyFile>src/main/resources/liquibase.properties</propertyFile>
</configuration>
</plugin>
</plugins>
</build>
changeLogFile=com/meshinnovation/gtcompany/db/changelog/changelog-master.xml
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/gt_crm?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull
username=gt_crm
password=9t_crm
verbose=true
dropFirst=true
Best Practice
ref: http://www.liquibase.org/bestpractices
架構
使用方式
Known Issues
MySQL enum 的 defaultValue 問題
<column defaultValue="private" name="share" type="enum('public','private')"/>
會有問題,
才是對的。(差一組 '')