Hello,
I had to do work in liquibase code and I could not expose here because the deadline of the project was so short. (If someone interests it, I use liquibase in a Spanish research project to manage database software unit automatically).
But now I have time to expose them:
The new functionalities are:
-
Enhancement of the data types coming from Hibernate: http://liquibase.org/forum/index.php?topic=255.0
-> for example: boolean, short, integer have an appriapate scale (not only number without scale)
-> to do this, I had to change mainly three things:
liquibase.database.Database.HibernateDatabaseSnapshot: inside method createSnapshot(…)
liquibase.change.Change.HibernateDatabase: introducing a new attribute: HibernateGenericDialect realDialect
liquibase.database.structure.Column: getDataTypeString(Database database) is now based in a new method -> getNumParensByDataType (Database database) -
ModifyDataTypes changes are supported from comparation between hibernate files and database already deployed (diff-database): http://liquibase.org/forum/index.php?topic=212
-> to do this, I had to change mainly one thing:
liquibase.database.structure.Column: isDataTypeDifferent(Column otherColumn) is modified to isDataTypeDifferent(Column otherColumn, Database thisDatabase, Database otherDatabase) adding an important method: isHibernateTypeDifferent (Column hibernateColumn, Column databaseColumn, Database database) -
Rollback (inverse changes) to DDL eliminatory changes is supported: http://liquibase.org/forum/index.php?topic=115
-> createInverses(DatabaseSnapshot snapshot) in: DropAllForeignKeyConstraintsChange, DropColumnChange, DropForeignKeyConstraintChange, DropIndexChange, DropNotNullConstraintChange (already done), DropPrimaryKeyChange, DropTableChange, DropUniqueConstraintChange, DropViewChange and ModifyDataTypeChange.
-> The best would be to add a option in every changeSet to select if this type of rollback is supported, gives a exception or is ignored (with a output trace for each impossible rollback exception). -
Default values from column modifications are supported in diff-database:
-> add defaultValue attribute to the classes: liquibase.change.core.ModifyDataTypeChange and liquibase.statement.SqlStatement.ModifyDataTypeStatement
-> liquibase.sqlgenerator.SqlGenerator.ModifyDataTypeGenerator shows the sql changes from default values.
-> The problem is that the changelog .xsd has to be changed adding the defaultValue field in the modifyColumn tag.
If anyone (Nathan?) wants to add any functionality to SVN liquibase code, I will do it. I can previously detail the code/classes-methods changes from the selected functionalities to add.