Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

eo-cqrs/cmig

 
 

Repository files navigation

Managed By Self XDSD

EO principles respected here DevOps By Rultor.com We recommend IntelliJ IDEA

mvn maven central javadoc codecov

Hits-of-Code Lines-of-Code PDD status License

Project architect: @h1alexbel

CMIG: Schema Migration tool for Apache Cassandra.

Motivation. We are lacking off with schema version control and automatic table creation in Cassandra. CMIG is suggesting schema control tool for that.

Principles. These are the design principles behind CMIG.

How to use. All you need is this (get the latest version here):

Maven:

<dependency>
  <groupId>io.github.eo-cqrs</groupId>
  <artifactId>cmig</artifactId>
</dependency>

In your resources directory you should create a cmig directory, and inside it new XML file, for instance master.xml:

<states>
  <changeState id="1" author="h1alexbel">
    <files>
      <file path="001-initial-keyspace.cql"/>
      <file path="002-queries-table.cql"/>
    </files>
  </changeState>
  <changeState id="2" author="h1alexbel">
    <files>
      <file path="003-stuff.cql"/>
    </files>
  </changeState>
</states>

Inside all the files you must have only one operation. Decompose files for better traceability.

In Java, all you need is to create Cassandra and Master objects:

final Cassandra cassandra = new Simple("localhost", 9042);
final String sha = new Preload(
  new Master("cmig/master.xml", cassandra),
  cassandra, "1" // datacenter of cmig keyspace
).value();

How to Contribute

Fork repository, make changes, send us a pull request. We will review your changes and apply them to the master branch shortly, provided they don't violate our quality standards. To avoid frustration, before sending us your pull request please run full Maven build:

$ mvn clean install

You will need Maven 3.8.7+ and Java 17+.

Our rultor image for CI/CD.