Hi,
I’m using Gradle 2.7, the HSQL DB (v 2.3.3) and the LIquibase 1.1.1 plugin. I’m trying to run my LIquibase script to set up an in-memory database for testing purposes. This is the first statement in my Liquibase changeling file …
<changeSet author="davea" id="add_my_prefix_sync_address">
<createTable tableName="my_prefix_sync_address">
<column defaultValue="" name="id" type="VARCHAR(32)">
<constraints nullable="false" primaryKey="true"/>
</column>
<column defaultValue="" name="address" type="VARCHAR(500)">
<constraints nullable="true"/>
</column>
<column defaultValue="" name="city" type="VARCHAR(100)">
<constraints nullable="true"/>
</column>
<column defaultValue="" name="state" type="VARCHAR(10)">
<constraints nullable="true"/>
</column>
<column defaultValue="" name="zip" type="VARCHAR(10)">
<constraints nullable="true"/>
</column>
<column defaultValue="" name="lattitude" type="INT UNSIGNED">
<constraints nullable="true"/>
</column>
<column defaultValue="" name="longitude" type="INT UNSIGNED">
<constraints nullable="true"/>
</column>
<column defaultValue="" name="email" type="VARCHAR(200)">
<constraints nullable="true"/>
</column>
<column defaultValue="" name="phone" type="VARCHAR(32)">
<constraints nullable="true"/>
</column>
<column defaultValue="" name="phone_type" type="VARCHAR(10)">
<constraints nullable="true"/>
</column>
</createTable>
</changeSet>
which dies immediately upon running “gradle build” with the exception …
SEVERE 10/25/15 2:22 PM: liquibase: src/main/resources/db.changelog-master.xml: src/main/resources/db.changelog-1.0.xml::add_my_prefix_sync_address::davea: Change Set src/main/resources/db.changelog-1.0.xml::add_my_prefix_sync_address::davea failed. Error: java.sql.SQLSyntaxErrorException: unexpected token: ,
liquibase.exception.DatabaseException: java.sql.SQLSyntaxErrorException: unexpected token: ,
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:316)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:122)
at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1227)
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1210)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:550)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:43)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73)
at liquibase.Liquibase.update(Liquibase.java:200)
at liquibase.integration.commandline.Main.doMigration(Main.java:1044)
at liquibase.integration.commandline.Main.run(Main.java:175)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
…
Does anyone know what is wrong or have another way to set up an in-memroy database (it doesn’t have to be HSQLDB, I just picked that because it was readily available). Below is how I’m setting up the test run …
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'mysql:mysql-connector-java:5.1.36'
classpath 'org.hsqldb:hsqldb:2.3.3'
classpath 'org.flywaydb:flyway-gradle-plugin:3.2.1'
}
}
plugins {
id "org.liquibase.gradle" version "1.1.1"
}
…
flyway {
url = 'jdbc:hsqldb:mem:test'
user = 'sa'
}
liquibase {
activities {
main {
File propsFile = new File(liquibasePropertiesFile)
Properties properties = new Properties()
properties.load(new FileInputStream(propsFile))
changeLogFile 'src/main/resources/db.changelog-master.xml'
url properties['url']
username properties['username']
password properties['password']
}
test {
File propsFile = new File(liquibasePropertiesFile)
Properties properties = new Properties()
properties.load(new FileInputStream(propsFile))
changeLogFile 'src/main/resources/db.changelog-master.xml'
url 'jdbc:hsqldb:mem:test'
username 'sa'
}
runList = 'main,test'
}
}
Thanks, - Dave