This repository has been archived by the owner on Jul 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Migrations
Herdy Handoko edited this page Apr 3, 2017
·
2 revisions
cassandra-migration
is designed to support a combination of migration methods:
- Standalone migration via uber-jar or use library API directly as part of your application
- Migrate schema using CQL files, Java classes, or a combination of both
- Configuration via passed-in system properties or centralised in a configuration file
- Schema version tracking statements use
ConsistencyLevel.ALL
for clustered hosts, otherwiseConsistencyLevel.ONE
for single host. - Users should manage their own consistency level in the migration scripts.
Applied schemas are tracked using a migration version table, as follows:
cassandra@cqlsh:cassandra_migration_test> select * from cassandra_migration_version;
type | version | checksum | description | execution_time | installed_by | installed_on | installed_rank | script | success | version_rank
-------------+---------+-------------+----------------+----------------+--------------+--------------------------+----------------+----------------------------------------+---------+--------------
CQL | 1.0.0 | 985950023 | First | 88 | cassandra | 2015-09-12 15:10:22-0400 | 1 | V1_0_0__First.cql | True | 1
CQL | 1.1.2 | 2095193138 | Late arrival2 | 3 | cassandra | 2015-09-12 15:10:23-0400 | 5 | V1_1_2__Late_arrival2.cql | True | 2
CQL | 1.1.3 | -1648933960 | Late arrival3 | 15 | cassandra | 2015-09-12 15:10:23-0400 | 6 | V1_1_3__Late_arrival3.cql | True | 3
CQL | 2.0.0 | 1899485431 | Second | 154 | cassandra | 2015-09-12 15:10:22-0400 | 2 | V2_0_0__Second.cql | True | 4
JAVA_DRIVER | 3.0 | null | Third | 3 | cassandra | 2015-09-12 15:10:22-0400 | 3 | migration.integ.V3_0__Third | True | 5
JAVA_DRIVER | 3.0.1 | null | Three zero one | 2 | cassandra | 2015-09-12 15:10:22-0400 | 4 | migration.integ.V3_0_1__Three_zero_one | True | 6