-
-
Notifications
You must be signed in to change notification settings - Fork 388
Description
Hi,
I've got a problem starting the javers app.
The first start (without javers tables) is executed without problems.
The second start goes wrong, SQL Exception because javers tries to recreate the schema for the table jv_commit (which already exists in the DB)
Going through the code, I found the error in the org.javers.repository.sql.schema.JaversSchemaManager
private void ensureTable(String tableName, Schema schema) {
if (schemaInspector.relationExists(tableName)) {
return;
}
logger.info("creating javers table {} ...", tableName);
schemaManager.create(schema);
}
The method ensureTable does not recognize that in the DB SQL Server the table jv_commit already exists and therefore launches again the CREATE TABLE.
This behavior is not present in version 5.0.0 of Javers (which I'm currently using to get around the problem).
Also I think that the problem is attributable to the polyjdbc library
The version of SQL Server I use is:
Microsoft SQL Server 2016 - 13.0.1708.0 (X64)
The JPA setting for the dialect is:
spring.jpa.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect