Hello,
we have Liquibase 2.0.5 in place and want to migrate to 3.4.x. We couldn´t find a migration guide or the existing guides contain almost no information.
What happened to the following / how can it be solved:
TypeConverterFactory - what can be used now instead?
How can statements like the following be replaced?
TypeConverterFactory.getInstance().findTypeConverter(database).getDataType(defaultValue).convertObjectToString(defaultValue, database)
We derived our own DB-Class from AbstractDatabase. We assume that this class was replaced by AbstractJdbcDatabase?
The class SelectSequencesStatement is not available anymore. What is its replacement?
What happened to AbstractTypeConverter and TypeConverter? And what is the replacement for the method convertToCorrectObjectType?
What happened to the method convertRequestedSchemaToSchema of objects of type Database?
This doc: Upgrading Liquibase | Liquibase Docs gives the principles on updgrading versions. For the more detailed questions, could you help me understand the context? How are you calling liquibase, and where are you making these function calls. The why would help too, as someone could recommend what to switch to.
Hi @ronak ,
in the old version of Liquibase some Data Types and Sequence Statements had to be adapted and registered because HANA database were not supported by Liquibase. We tried to adapt those classes to the new version of Liquibase but found out that there is already an extension doing this.
Due to the fact that it is quite an old project, some of the data types like Boolean are still incompatible with the new version of the extension and HANA DB. Boolean is represented as SMALLINT instead of BOOLEAN in the database.
Regarding your question how we are using Liquibase. It is used and loaded together with spring in a subclass of SpringLiquibase (via the application context). The corresponding supported Databases are loaded. We do a clear of the database registry and after that register only the ones we would like to support.
final DatabaseFactory df = DatabaseFactory.getInstance();
df.clearRegistry();
df.register(new HanaDatabase());
So this loads only the HANA DB extension.
When we start our server we see an exception that the type BOOLEAN is not comparable with type SMALLINT. So as a next step we have extended the class BooleanTypeHana of the Liquibase HANA extension. We have only overwritten the method toDatabaseDataType to return the DatabaseDataType SMALLINT instead of BOOLEAN.
In the subclass of SpringLiquibase we unregister the original BooleanTypeHana and register our own LiquibaseDataType.
DataTypeFactory dtf = DataTypeFactory.getInstance();
dtf.unregister(new BooleanTypeHana().getName());
dtf.register(BooleanTypeHDB.class);
This doesn´t seem to be working and we are still getting the same error/exception.
inconsistent datatype: BOOLEAN type is not comparable with SMALLINT type
Do you know how to get that error solved? The unregister und register doesn´t seem to have any effect.