liquibase/liquibase-cassandra

Custom change log and -lock tables with keyspace issue

denyskonakhevych opened this issue · 1 comments

In my case I have multiple services and for each I want to have separate pair of change log tables.
The problem is that underlying logic either uses custom table names without keyspace or changeloglock table is hardcoded with 'DATABASECHANGELOGLOCK' value

┆Issue is synchronized with this Jira Bug by Unito

Hello,

I got a similar problem, it may be also fixed by the awaiting PR.

I'm using Liquibase Cassandra Ext via Spring Boot

when I try to specify different table names for the log table and the lock log table it fails looking for the default table name.

this configuration works

spring:
  liquibase:
    change-log: classpath:/db/migration/cassandra/main-changelog.xml
    url: jdbc:cassandra://${spring.data.cassandra.contact-points}:${spring.data.cassandra.port}/${spring.data.cassandra.keyspace-name};DefaultKeyspace=${spring.data.cassandra.keyspace-name}
    driver-class-name: com.simba.cassandra.jdbc42.Driver

the following doesn't

spring:
  liquibase:
    change-log: classpath:/db/migration/cassandra/main-changelog.xml
    database-change-log-table: change_log
    database-change-log-lock-table: change_log_lock
    url: jdbc:cassandra://${spring.data.cassandra.contact-points}:${spring.data.cassandra.port}/${spring.data.cassandra.keyspace-name};DefaultKeyspace=${spring.data.cassandra.keyspace-name}
    driver-class-name: com.simba.cassandra.jdbc42.Driver

it gives the following exception: com.simba.cassandra.shaded.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table change_log_lock.

and the log says that it's looking for DATABASECHANGELOGLOCK

liquibase.ext : No DATABASECHANGELOGLOCK available in cassandra.
liquibase.ext : successfully.acquired.change.log.lock
liquibase.ext : expecting exactly 1 table with name change_log, got 0
liquibase.ext : Creating database history table with name: keyspace.change_log
liquibase.ext : Reading from keyspace.change_log
liquibase.ext : Successfully released change log lock
liquibase.hub : Could not release lock

liquibase.ext : Waiting for changelog lock....
liquibase.ext : Successfully released change log lock
liquibase : Could not release lock