generateChangeLog for oracle includes invalid SQL

Environment

None

Activity

Show:

Andy Goossens February 12, 2013 at 5:58 PM

I saw a similar issue with Liquibase 2.0.5.

A column originally created like this:

... isValid CHAR(1) DEFAULT(1) NOT NULL ...

Was exported by Liquibase as:

<column defaultValue="(1) " name="ISVALID" type="CHAR(1)"> <constraints nullable="false"/> </column>

When Oracle has to use the default value to insert a new row, it will complain:

java.sql.SQLException: ORA-12899: value too large for column "MYSCHEMA"."MYTABLE"."ISVALID" (actual: 4, maximum: 1)

Doug Chew June 23, 2011 at 10:07 PM

Here's another example of bad SQL from generateChangeLog (Liquibase version 2.0.1:

<createTable schemaName="sis" tableName="AWRD_COURSE_RESTRICTIONT">
<column defaultValue="0 " name="AWD_ENROLLED_ALLOWED" type="CHAR(1)">
<constraints nullable="false"/>
</column>
</createTable>

The default value has a space that should not be there and since the column is CHAR(1), this causes problem in creating the table.

Details

Reporter

Priority

Created June 9, 2011 at 5:59 PM
Updated June 12, 2013 at 6:01 PM