I’m trying to setup Liquibase with Cassandra and while I appear to be able to connect, the problem begins when Liquibase tries to create a DATABASECHANGELOG
table into the database.
I have been referencing the following information:
- Liquibase for Apache Cassandra - contribute.liquibase.com
- Get the new Cassandra driver for Liquibase 4.25.0+ | Cassandra versioning support with Liquibase (BTW, there is a typo that references
Localdatacetner
instead oflocaldatacenter
).
The version of Liquibase being used is 4.27.0
.
The version of Cassandra being used is 3.11.9
.
I downloaded the following wrapper and extension files from their recommended sources:
- cassandra-jdbc-wrapper-4.12.0-bundle.jar
- liquibase-cassandra-4.27.0.jar
My liquibase.properties
file:
classpath=liquibase_libs/cassandra-jdbc-wrapper-4.12.0-bundle.jar
driver=com.ing.data.cassandra.jdbc.CassandraDriver
changeLogFile=changelog/changelog-root.yaml
When I run the following from the root directory of my Liquibase project folder:
liquibase status --username=<username> --password=<password> --url=jdbc:cassandra://localhost:9042/<database_name>?localdatacenter=datacenter1&compliancemode=Liquibase
I get the following output:
## _ _ _ _ ##
## | | (_) (_) | ##
## | | _ __ _ _ _ _| |__ __ _ ___ ___ ##
## | | | |/ _` | | | | | '_ \ / _` / __|/ _ \ ##
## | |___| | (_| | |_| | | |_) | (_| \__ \ __/ ##
## \_____/_|\__, |\__,_|_|_.__/ \__,_|___/\___| ##
## | | ##
## |_| ##
## ##
## Get documentation at docs.liquibase.com ##
## Get certified courses at learn.liquibase.com ##
## ##
####################################################
Starting Liquibase at 17:49:55 (version 4.27.0 #1525 built at 2024-03-25 17:08+0000)
Liquibase Version: 4.27.0
Liquibase Open Source 4.27.0 by Liquibase
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
ERROR: Exception Details
ERROR: Exception Primary Class: SyntaxError
ERROR: Exception Primary Reason: line 1:42 no viable alternative at input '(' (CREATE TABLE DATABASECHANGELOG (ID [VARCHAR](...)
ERROR: Exception Primary Source: Cassandra 3.11.9
Unexpected error running Liquibase: line 1:42 no viable alternative at input '(' (CREATE TABLE DATABASECHANGELOG (ID [VARCHAR](...) [Failed SQL: (0) CREATE TABLE DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED datetime NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10))]
For more information, please use the --log-level flag
Would anyone be able to provide more assistance to why this is happening? Thanks