- Notifications
You must be signed in to change notification settings - Fork10
Simple python program for managing Cassandra schema migrations
License
dmchoull/cdeploy
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This repo is not being maintained - please use the fork at:https://github.com/rackerlabs/cdeploy
cdeploy is a simple tool to manage your Cassandra schema migrations in the style ofdbdeploy
pip install cdeploy
By default, cdeploy will look for migrations in './migrations'. This can be overridden by passing the path to your migrations directory as the first argument:
cdeploy db/migrationsThe migrations directory should contain CQL scripts using the following naming convention: [version]_migration_description.cql
For example:
migrations/ 001_create_orders_table.cql 002_create_customers_table.cqlVersion numbers should begin from 1. Migration scripts may contain multiple semicolon terminated CQL statements. Comment lines can begin with either "--" or "//".
Migrations can also specify how to revert the changes by including additional statements following a line containing "--//@UNDO". For example:
CREATE TABLE orders( order_id uuid PRIMARY KEY, price text);--//@UNDODROP TABLE orders;To undo the most recently applied migration, run:
cdeploy --undocdeploy will look in your migrations directory for a configuration file named cassandra.yml, in a subdirectory named config:
migrations/ config/ cassandra.ymlThe configuration file specifies the hosts to connect to and the keyspace name, and supports multiple environments. For example:
development: hosts: [host1] keyspace: keyspace_nameproduction: hosts: [host1, host2, host3] keyspace: keyspace_nameThe environment can be set via the ENV shell variable, and defaults to development if not specified:
ENV=production cdeployAbout
Simple python program for managing Cassandra schema migrations
Resources
License
Uh oh!
There was an error while loading.Please reload this page.