liquibase gradle不会提交更改

时间:2014-05-14 14:24:21

标签: gradle liquibase

我已经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

1 个答案:

答案 0 :(得分:0)

我忘了将schemaName添加到我的更改日志文件中。 schemaName可以正常使用