Liquibase applying change log for different schema

Description

As seen in the log, I am trying to update change log for TENANT_001DEV.
But liquibase is trying to add change log for SCDB2 schema.
As we have a multitenant database it is causing issue for our application.

As seen in screenshot-
liquibasePerConn.getDatabase().getDefaultSchema()
liquibasePerConn.getDatabase().getDefaultSchemaName()
liquibasePerConn.getDatabase().getLiquibaseSchemaName()

all are showing TENANT_001DEV. But still change log is getting applied for SCDB2 schema
Please provide me solution as soon as possible.

Jan 25, 2018 10:47:39 PM curam.database.evolver.task.DropTableProcessor dropTables
INFO: Dropping tables
Jan 25, 2018 10:47:41 PM curam.database.evolver.task.DatabaseTask executeChangeLogPerConn
INFO: Executing for schema - [TENANT001_DEV]dbupgrade/versions/1.1.39.0/tenant/baseline/baseline-ddl.xml
Jan 25, 2018 10:47:41 PM curam.database.evolver.CuramLiquibase getLiquibasePerConn
INFO: Getting Liquibase for schema TENANT001_DEV
Jan 25, 2018 10:47:41 PM curam.database.evolver.CuramLiquibase applyChangesPerConn
INFO: liquibasePerConn.getDatabase().getDefaultSchema() TENANT001_DEV.TENANT001_DEV
Jan 25, 2018 10:47:41 PM curam.database.evolver.CuramLiquibase applyChangesPerConn
INFO: liquibasePerConn.getDatabase().getDefaultSchemaName() TENANT001_DEV
Jan 25, 2018 10:47:41 PM curam.database.evolver.CuramLiquibase applyChangesPerConn
INFO: liquibasePerConn.getDatabase().getLiquibaseSchemaName()TENANT001_DEV
SEVERE 1/25/18 10:47 PM: liquibase: dbupgrade/versions/1.1.39.0/tenant/baseline/baseline-ddl.xml: dbupgrade/versions/1.1.39.0/tenant/baseline/baseline-ddl.xml::1::Generated: Change Set dbupgrade/versions/1.1.39.0/tenant/baseline/baseline-ddl.xml::1::Generated failed. Error: DB2 SQL Error: SQLCODE=-601, SQLSTATE=42710, SQLERRMC=SCDB2.APPRESOURCE;TABLE, DRIVER=4.19.66 [Failed SQL: CREATE TABLE SCDB2.APPRESOURCE (NAME VARCHAR(1016), CONTENTTYPE VARCHAR(400), CONTENTDISPOSITION VARCHAR(1016), CONTENT BLOB(5242880), INTERNAL CHARACTER(1) NOT NULL, RESOURCEID BIGINT NOT NULL, DESCRIPTION VARCHAR(8000), CATEGORY CHARACTER(40), LOCALEIDENTIFIER CHARACTER(40), VERSIONNO INTEGER NOT NULL, LASTWRITTEN TIMESTAMP) COMPRESS YES ]
liquibase.exception.DatabaseException: DB2 SQL Error: SQLCODE=-601, SQLSTATE=42710, SQLERRMC=SCDB2.APPRESOURCE;TABLE, DRIVER=4.19.66 [Failed SQL: CREATE TABLE SCDB2.APPRESOURCE (NAME VARCHAR(1016), CONTENTTYPE VARCHAR(400), CONTENTDISPOSITION VARCHAR(1016), CONTENT BLOB(5242880), INTERNAL CHARACTER(1) NOT NULL, RESOURCEID BIGINT NOT NULL, DESCRIPTION VARCHAR(8000), CATEGORY CHARACTER(40), LOCALEIDENTIFIER CHARACTER(40), VERSIONNO INTEGER NOT NULL, LASTWRITTEN TIMESTAMP) COMPRESS YES ]
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:301)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:107)
at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1251)
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1234)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:554)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73)
at liquibase.Liquibase.update(Liquibase.java:212)

Environment

MAC , LINUX and Windows

Status

Assignee

Unassigned

Reporter

Guru Prasad

Labels

None

Affects versions

Priority

Blocker
Configure