Question

I've got 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>

In my build.gradle I've got

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
}

But despite being successful - to my database it does not add any new table. I've got postreSQL with scheme where all my tables are located - simpleScheme

My console output

: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
Was it helpful?

Solution

I forgot to add schemaName to my change log file. With schemaName it works properly

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top