A new topic, 'hibernate integration + diff bug', has been made on a board you
are watching.
You can see it at
http://liquibase.org/forum/index.php?topic=54.new#new
The text of the topic is shown below:
hi !
first off i'd like to say i'm really glad i found liquibase, the idea and
features are great.
I was planning to use hbm2ddl to incrementally update the database after
changes to my hibernate mappings. Unfortunately i had to find out that hbm2ddl
either does not remove dropped columns/tables or drops and recreates everything
if you force it to take care of that issue. Because i need to keep the data
that is already stored i was going to make my own evil dirty version of hbm2ddl
that should do the trick, but lucky me, i found liquibase.
i use Diff with a HibernateDatabase created with my hibernate.cfg.xml file and
a MySQLDatabase.
The change-sets are written like that:
Code:
Diff diff = new Diff(hDB, mySQLDB);
diff.addStatusListener(new LogDiffStatusListener());
DiffResult diffResult = diff.compare();
logger.debug("writing diffLog file: " + changeLogFile);
diffResult.printChangeLog(changeLogFile, mySQLDB);
it works very well most of the time but i found a couple of things that i
consider to be bugs:
(Version 1.9.3)
1. changes of datatypes are not detected (deliberately ignored)
sourcefile: HibernateDatabaseSnapshot.java
Code:
#82 column.setCertainDataType(false);
in my case i tried to change an integer to a double, but because every column
in a HibernateDatabaseSnapshot is set to have no "certain datatype" the method
isDataTypeDifferent of Column ignores the difference in line #273
Code:
#272 public boolean isDataTypeDifferent(Column otherColumn) {
#273 if (!this.isCertainDataType() ||
!otherColumn.isCertainDataType()) {
#274 return false;
#275 ...
during the diff.compare() process.
2. invalid schema for drop column change-set
sourcefile: DiffResult.java
Code:
#633 change.setSchemaName(column.getTable().getName());
In my opinion this is a copy paste typo and i wonder why it has not been
detected by now. It should instead be column.getTable().getSchema().
Therefore it currently leads to a
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table
'tablename.tablename doesn't exist exception if the exported change-set is used
to update the database.
I will try to fix these small things and see if they are the only issues that
prevent me from successful ddl update with liquibase. Hopefully more people
will use this tool with hibernate so it will mature in quality and features :)
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.------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Liquibase-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/liquibase-user