A new topic, 'Liquibase issue when adding new column with default value with
database Sybase', has been made on a board you are watching.
You can see it at
http://liquibase.org/forum/index.php?topic=704.new#new
The text of the topic is shown below:
Hello All,
I came across this issue while I was trying to add a new column with default
value with sybase as database
<changeSet id="ABCD" author="XYZ">
<addColumn tableName="table1">
<column name="col1" type="char(1)" defaultValue="N" >
<constraints nullable="false"/>
</column>
</addColumn>
</changeSet>
Error -
ALTER TABLE [table1] ADD [col1] CHAR(1) NOT NULL DEFAULT 'N'
Caused By: Error executing SQL ALTER TABLE [table1] ADD [col1] CHAR(1) NOT NULL
DEFAULT 'N':
Caused By: Incorrect syntax near the keyword 'DEFAULT'.
When I went through the source code of Liquibase - Class
AddColumnStatement.java [Method - getSqlStatement] found that Default is always
added after NOT NULL/NULL text (for sybase ofcourse), reason is one of the
method is not returning sybase instance and as per sybase syntax Default should
come before NOT NULL/NULL
Jar with the modified code is working fine. Please find the attached files
(original and modified by me) and let me know if the change is really needed.
Unsubscribe to new topics from this board by clicking here:
http://liquibase.org/forum/index.php?action=notifyboard;board=1.0
Regards,
The Liquibase Community Forum Team.------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Liquibase-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/liquibase-user