:app-core:updateDb FAILED due to SYS_DB_CHANGELOG

We’re using:
Microsoft SQL Server 2012 v11.0.2100.
Cuba studio 6.5.0
Cuba platform 6.5.3

When I create the database using cuba.studio all tables get created successfully with no errors, but when I try to update the database, the update task fails with the following error:

Table SYS_DB_CHANGELOG does not exist, running all init scripts
Failed to execute: create table SYS_DB_CHANGELOG (SCRIPT_NAME varchar(300) not null primary key, CREATE_TS datetime default current_timestamp, IS_INIT integer default 0) because: There is already an object named 'SYS_DB_CHANGELOG' in the database.

Here’s the updateDb task that we’re using:

task updateDb(dependsOn: assembleDbScripts, description: 'Updates local database', type: CubaDbUpdate) {
        connectionParams = ';currentSchema=DB_SCHEMA;instance=SQLEXPRESS'
        dbms = 'mssql'
        host = 'localhost'
        dbName = 'DATABASE_NAME'
        dbUser = 'DATABASE_USER'
        dbPassword = 'PASSWORD'

We previously specified the dbmsVersion = ‘2012’ but that didn’t help either.
The task is failing although the SYS_DB_CHANGELOG and SEC_USER tables are created.

1 Like

Okay so when we removed “currentSchema=DB_SCHEMA” from the connection params, it worked. Although the documentation specifies that we must create and specify a schema in the connection params.


Could you point out what statement in the documentation confused you? We’d like to make it more clear.