A new topic, 'How do I modify how XML Changelogs are written?', has been made 
on a board you are watching.

You can see it at
http://liquibase.org/forum/index.php?topic=525.new#new

The text of the topic is shown below:

Hi,
What I'm doing is loading a Changelog into an HSQL database, then diffing it 
against a MySQL database (which happens to be empty in this case).  The diff 
creates a new Changelog reporting all the differences (which should be the same 
as the original Changelog that was loaded into HSQL), but types such as CLOB 
are converted into VARCHAR(1048768) in the new Changelog.  Then I try to do an 
Update to sync all the differences that were found into the MySQL database, but 
it fails because MySQL doesn't like VARCHAR(1048768)
Code:
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Column length too big for 
column 'BLOB_1MB' (max = 65535); use BLOB or TEXT instead

We already "fixed" the Diff comparison to get around this by doing this in the 
Column.isDataTypeDifferent() function:
Code:
            if (this.getTable().getDatabase() instanceof HsqlDatabase) {
                final int DEFAULT_HSQL_LOB_SIZE = 1048576;
                if (this.getDataType() == Types.VARCHAR && this.getColumnSize() 
== DEFAULT_HSQL_LOB_SIZE) {
                        thisDataType = "CLOB";
                }
                if (this.getDataType() == Types.VARBINARY && 
this.getColumnSize() == DEFAULT_HSQL_LOB_SIZE) {
                        thisDataType = "BLOB";
                }
            }
            if (otherColumn.getTable().getDatabase() instanceof HsqlDatabase) {
                final int DEFAULT_HSQL_LOB_SIZE = 1048576;
                if (otherColumn.getDataType() == Types.VARCHAR && 
otherColumn.getColumnSize() == DEFAULT_HSQL_LOB_SIZE) {
                        otherDataType = "CLOB";
                }
                if (otherColumn.getDataType() == Types.VARBINARY && 
otherColumn.getColumnSize() == DEFAULT_HSQL_LOB_SIZE) {
                        otherDataType = "BLOB";
                }
            }

But that only works for comparing them, but not for writing the XML changelog.  
I think I can fix my problem by doing the same type of thing in the code that 
writes the XML Changelog, but I'm not exactly sure where that code should go.  
Any ideas?

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.
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Liquibase-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/liquibase-user

Reply via email to