I updated version of com.h2database from 1.4.200 -> 2.0.202. and the version of liquibase is 4.3.5.
JDBC connection string looks like:
jdbc:h2:mem:database1;DB_CLOSE_DELAY=-1;MODE=Oracle;
And, I have a liquibase changeSet like this:
> databaseChangeLog:
> - changeSet:
> id:01
> author:XYZ
> changes:
> - createTable:
> columns:
> - column:
> autoIncrement:true
> constraints:
> nullable: false
> primaryKey: true
> primaryKeyName: PK_table_employee
> name: id
> type: int
> - column:
> name: name
> type: nvarchar(255)
> tableName: table_employee
The given changeSet when executed creates "table-employee" in H2 (version 1.4.200), but the same changeSet gives an Error saying:
Error creating bean with name 'liquibase; defined in class path .....
Reason: liquibase.exception.DatabaseException: Syntax error in SQL statement "CREATE TABLE DBO.TBL_EMPLOYEE (ID INT AUTO_INCREMENT[*], NAME NVARCHAR(255))"
.....
I see "AUTO_INCREMENT" does not work in H2 (version 2.0.202).
Is there any workaround to resolve this issue ?