views:

53

answers:

1

Hello Expert!!

I'm using liquibase on a project and i just realize what makes my build fails.i've successfully use command line generateChangeLog against the same schema in mysql and included that file in my master-change-log file.

For test environment i use hsqldb.Now all the table name are hyphen separated apart from language.Since my build were failing i opened my mydb.script and all the hyphen separated Tables name were in capital but language looks like this

CREATE MEMORY TABLE SOME_TABLE(ID BIGINT NOT NULL,OBJ_VESION INTEGER DEFAULT 0 NOT NULL,REQUESTER_PHONE VARCHAR(20),FORM_CODE VARCHAR(100),DATE_STARTED TIMESTAMP,DATE_ENDED TIMESTAMP,LAST_ACTIVITY TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,SOME_TABLE_STATUS VARCHAR(255),CONSTRAINT PK_INCOMING_MESSAGE_SESSION PRIMARY KEY(ID))  

CREATE MEMORY TABLE "language"(ID BIGINT NOT NULL,CODE VARCHAR(10),NAME VARCHAR(50),DESCRIPTION VARCHAR(255),CONSTRAINT PK_LANGUAGE PRIMARY KEY(ID))

and in the change log file they look like this

<changeSet author="highjo (generated)" id="1282409084036-10">
    <createTable tableName="some_table">
        <column name="id" type="BIGINT">
            <constraints nullable="false" primaryKey="true"/>
        </column>
        <column defaultValueNumeric="0" name="obj_vesion" type="INT">
            <constraints nullable="false"/>
        </column>
       <!-- ... -->
    </createTable>
</changeSet>
<changeSet author="highjo (generated)" id="1282409084036-11">
    <createTable tableName="language">
        <column name="id" type="BIGINT">
            <constraints nullable="false" primaryKey="true"/>
        </column>
        <column name="code" type="VARCHAR(10)"/>
        <!-- .... -->
    </createTable>
</changeSet>

as you can notice they are all in small letters in the changelog file.I've tried changing in the change log language to capital, and in the script it is in capital just that it still has the double quote. :(

How it is possible to fix this? thanks for reading.

A: 

I think the reason language is quoted is because it us a reserved word in hsql and so liquibase quotes it so the SQL doesn't fail.

The escaping rules may have changed for liquibase 2.0, but if not you could override the escapeObject method in q custom database class easier and see if it works.

The quotes shouldn't matter, though. They shouldn't occur in the table name itself.

Nathan Voxland
makes sens.Thanks !!
black sensei