Contrast-Security-OSS / cassandra-migration

Database migration (evolution) tool for Apache Cassandra
Apache License 2.0
107 stars 51 forks source link

No way to use it for automation #23

Open CyborTronik opened 8 years ago

CyborTronik commented 8 years ago

Nice project. But there is a issue for using it for automation. It requires to have keyspace created before migration, but how to create keyspace itself if I'm interested just for some quick check?

And for production yes, keyspace must be created by devops.

It's not actual issue for this project, but would be nice to have such feature for wide usage.

hhandoko commented 8 years ago

@CyborTronik you can create the keyspace by executing ad-hoc CQL. Assuming you have configured a Session beforehand: session.execute(statement).

Example (for Cassandra v3+), find existing keyspaces and create statements:

SELECT *
FROM system_schema.keyspaces
WHERE keyspace_name = {{your_keyspace}}
CREATE KEYSPACE {{your_keyspace}}
WITH REPLICATION = {
  'class' : 'SimpleStrategy',
  'replication_factor' : '1'
}
felixgao commented 7 years ago

yea I would second to have the migration tool have an option to create keyspace if supplied an cql file.