读书人

liquibase数据收拾

发布时间: 2012-07-04 19:33:55 作者: rapoo

liquibase数据整理
代码如下

java -jar liquibase.jar update


在同一个目录下建立,liquibase.properties
内容如下
#liquibase.propertiesdriver: com.mysql.jdbc.Driverclasspath: jdbcdriver.jarchangeLogFile:changelog.xmlurl:jdbc:mysql://192.168.0.182:3306/bbscs8?useUnicode=true&characterEncoding=UTF-8username:root1password:testroot

jdbcdriver是同一目录下数据库的jar包,changelog.xml为改变数据库的内容,
以下是changelog.xml的内容
<?xml version="1.0" encoding="UTF-8"?> <databaseChangeLog  xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.7"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.7         http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.7.xsd"></databaseChangeLog>

运行一次,数据库里面生成两张表
databasechangelog
databasechangeloglock两种表
然后将改变数据库的语句加入

读书人网 >其他数据库

热点推荐