【发布时间】:2014-05-14 14:24:20
【问题描述】:
我有databaseChangeLog.xml
<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="Artsiom">
<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>
在我的build.gradle 我有
liquibase {
changelogs {
main {
file = file('databaseChangeLog.xml')
}
}
databases {
myDB {
url = props.getProperty("db.url") + "/" + props.getProperty("db.name")
username = props.getProperty("db.admin")
password = props.getProperty("db.admin.password")
}
}
defaultDatabase = databases.myDB
}
但是尽管成功了 - 我的数据库并没有添加任何新表。
我有 postreSQL 与我所有表所在的方案 - simpleScheme
我的控制台输出
:updateSQL
INFO 5/14/14 5:30 PM:liquibase: Successfully acquired change log lock
INFO 5/14/14 5:30 PM:liquibase: D:/projects/test_gradled/test/databaseChangeLog.xml is using schema version 3.1 rather tha
n version 2.0
INFO 5/14/14 5:30 PM:liquibase: Reading from databasechangelog
INFO 5/14/14 5:30 PM:liquibase: Reading from databasechangelog
INFO 5/14/14 5:30 PM:liquibase: Successfully released change log lock
-- *********************************************************************
-- Update Database Script
-- *********************************************************************
-- Change Log: D:/projects/test_gradled/test/databaseChangeLog.xml
-- Ran at: 5/14/14 5:30 PM
-- Against: postgres@jdbc:postgresql://localhost:5432/myDB
-- Liquibase version: 2.0.5
-- *********************************************************************
-- Lock Database
-- Release Database Lock
INFO 5/14/14 5:30 PM:liquibase: Successfully released change log lock
BUILD SUCCESSFUL
【问题讨论】: