Cassanda migration using CQLSH for node DB migration
This module is based on node-db-migrate to support migration for Cassandra database, using node cassadnra-driver. This has to be installed as a dependency for db-migrate.
npm install db-migrate
npm install db-migrate-cassandra
Set up your database.json as mentoned in database.json.example
- Create Table
exports.up = function (db, callback) { db.createTable('users', { 'name': 'varchar', 'age': 'int' }, { 'primary_key': 'name' }, callback);
};
Supports multiple parimary keys
```js
'primary_key': '(name, age)'
-
Drop Table
exports.up = function (db, callback) { db.dropTable('users', callback); };
-
Add new column
exports.up = function (db, callback) { db.addColumn('users', 'age', 'int', callback); };
-
Drop existing column
exports.up = function (db, callback) { db.removeColumn('users', 'age', callback); };
-
Rename a column
exports.up = function (db, callback) { db.renameColumn('users', 'age', 'age2', callback); };
-
Change column type
exports.up = function (db, callback) { db.changeColumn('users', 'age', 'blob', callback); };
- This module is built using
cassandra-driver
need to add support for creating new keyspace.
- Fork the repository
- Build the feature
- Add tests
- Raise a pull request