Liquibase Cassandra support summary
Liquibase 5.0+ provides native support for Apache Cassandra databases within the Liquibase database change management framework. This integrated functionality allows you to manage Cassandra schema changes using standard Liquibase changesets with Cassandra-specific adaptations.
Supported Change Types
Supported Commands
Update Commands
Data Types
Liquibase Secure 5.0+ supports native Cassandra data types:
Text and String Types
Liquibase Type | Cassandra Type | Notes |
varchar | varchar | No length parameter needed |
text | text | Native Cassandra text type |
Numeric Types
Liquibase Type | Cassandra Type |
int | int |
bigint | bigint |
smallint | smallint |
tinyint | tinyint |
float | float |
double | double |
decimal | decimal |
varint | varint |
Date and Time Types
Liquibase Type | Cassandra Type | Notes |
date | date | Date only (no time) |
timestamp | timestamp | Date and time with milliseconds |
time | time | Time only |
Other Types
Liquibase Type | Cassandra Type | Notes |
boolean | boolean | True/false values |
uuid | uuid | Universally unique identifier |
timeuuid | timeuuid | Time-based UUID |
blob | blob | Binary large object |
inet | inet | IP address (IPv4 or IPv6) |
Collection Types
Cassandra collections can be used in their native form:
list<type>- Ordered collectionset<type>- Unordered unique collectionmap<keytype, valuetype>- Key-value pairs
Cassandra-Specific Behaviors
No NOT NULL Constraints
Cassandra does not support NOT NULL constraints. Liquibase Secure 5.0+ automatically removes these constraints during SQL generation.
<!-- This constraint is ignored -->
<column name="email" type="varchar">
<constraints nullable="false"/>
</column>
Primary Keys Required
All Cassandra tables must have at least one primary key column. Liquibase Secure 5.0+ does not validate this, but Cassandra will reject tables without primary keys.
Auto-Commit Always Enabled
Cassandra operates in auto-commit mode. Transaction control methods are no-ops.
JAVA:
// These methods have no effect in Cassandra
database.setAutoCommit(false); // Does nothing
Case Sensitivity
Cassandra is case-sensitive for identifiers. Use quotes to preserve case:
SQL:
-- Different identifiers
CREATE TABLE MyTable (...) -- stored as mytable
CREATE TABLE "MyTable" (...) -- stored as MyTable
No Sequences Support
Cassandra does not support sequences. Use UUIDs or application-level ID generation instead.
No Foreign Keys
Cassandra does not support foreign key constraints. Liquibase Secure 5.0+ ignores foreign key definitions.
No Tablespaces
Cassandra does not support tablespaces. Tablespace attributes are ignored.
Index Naming
Unlike traditional databases, Cassandra index names do not include the keyspace prefix in DROP INDEX statements.
Snapshot Support
Snapshots are not supported as of Liquibase Secure 5.0.3.
Limitations
Not Supported
The following Liquibase Secure features are not supported for Cassandra:
Sequences - Use UUIDs or application-level generation
Foreign Keys - Cassandra is schema-less for relationships
NOT NULL Constraints - Automatically stripped from changesets
Unique Constraints (except primary keys)
Default Values - Not enforced at database level
Auto-increment Columns - Use UUIDs instead
Views - Cassandra materialized views have different semantics
Stored Procedures/Functions - Use User Defined Functions (UDFs) via raw SQL
Triggers - Not supported in Cassandra
Tablespaces - Different storage architecture
Schemas - Use keyspaces instead
Drop Table Cascade - No constraint cascading
Database Inspection Commands - snapshot, generate-changleog, diff-changelog, diff
DATABASECHANGELOGHISTORY - not supported
Stored Logic - not applicable
Partial Support
Alter Column - Limited to renaming; type changes not supported
Comments - Only table-level comments via setTableRemarks
Indexes - Limited customization; use raw SQL for custom index options