
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
cassandra-migration
Advanced tools
:warning: Looking for a new maintainer: Let me know if you are prior contributor or maintainer who is interested in taking over.
Migrates the schema of Cassandra based on the definition contained within CQL files matching the specified naming convention in the specified directory.
npm install --save cassandra-migration
By default the script will look for a file named migrate.json
Run the script
cassandra-migration migrate.json
The configuration file contains general options at the top level and the cassandra connection configuration.
The cassandra section should comply with the configuration supported by the cassandra-driver module.
All other sections provide directives to the tool itself.
The keyspace is required, and must be created outside of the migrations.
The schema_version table will be created within this keyspace.
Example config:
{
"migrationsDir": "cassandra/schema/migrations",
"quiet": false,
"cassandra": {
"contactPoints": [ "cass0", "cass1" ],
"datacenterName": "datacenter1",
"localDataCenter": "datacenter1",
"useSingleNode": false,
"keyspace": "data",
"protocolOptions": {
"port": 9042
},
"socketOptions": {
"connectTimeout": 15000
}
},
"auth": {
"username": "foo",
"password": "bar"
}
}
auth section of the config is optional.datacenterName is optional but needed when useSingleNode is set to true. If it is configured, the Cassandra client will use WhiteListPolicy and tries to connect only via the first node of contactPoints that you configured. This follows the recommendations of DataStax to only migrate one node at a time and let the cluster replicate the schema updates itself. Otherwise, there is a chance that the cluster breaks.The migration files should all be reside at the root level of the directory
specified by migrationDir in the config file. Each configuration file should
follow the format <VERSION>__<TITLE>.cql
Each query statement within the file should be separated by three hyphens: ---
Example:
CREATE TABLE my_keyspace.my_first_table (
id int PRIMARY KEY,
name text,
record_timestamp timestamp
);
---
CREATE TABLE my_keyspace.my_second_table (
id int PRIMARY KEY,
description text,
record_timestamp timestamp
);
npm run build
npm run release. The command will automatically do a version bump.npm run release
Versioning package...
Pushing new release tag to GitHub...
Creating a new GitHub release...
FAQs
Simple schema migration tool for Apache Cassandra
We found that cassandra-migration demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.