Registry / database / scylla-migration

scylla-migration

JSON →
library2.4.4jsnpmunverified

A Node.js schema migration tool for ScyllaDB (and Cassandra), based on node-cassandra-migration. Use it to manage database schema changes via CQL migration files. The current stable version is 2.4.4. It runs in Node.js environments (engine >=0.10). It differs by adding ScyllaDB-specific updates to an otherwise unmaintained Cassandra migration tool. It is a simple, file-based migration system with a JSON config file.

npm install scylla-migration
INSTALL
IMPORT
SIG · SCYLLA-MIGRATION
S
scylla-migration
databasejavascriptv2.4.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

scylla-migration
const scyllaMigration = require('scylla-migration');
import scyllaMigration from 'scylla-migration';
This package is CommonJS-only (no ESM). Use require().
migrateConfig
const config = require('./migrate.json');
The tool reads a JSON config file at runtime, not via code import.

Shows how to install, configure, create a CQL migration file, and run the migration.

// 1. Install // npm install --save scylla-migration cassandra-driver // 2. Create migrate.json { "migrationsDir": "migrations", "cassandra": { "contactPoints": ["127.0.0.1"], "keyspace": "mykeyspace" } } // 3. Create a migration file: migrations/001__initial.cql // Content: CREATE TABLE mykeyspace.users ( id int PRIMARY KEY, name text ); --- // 4. Run // npx scylla-migration migrate.json
Debug
Known issues
gotchaKeyspace must exist before running migrations; it is not created automatically.
fix
Create the keyspace manually (e.g., via cqlsh) before running scylla-migration.
affects: >=0.0.0
gotchaMigration files must follow naming convention <VERSION>__<TITLE>.cql (double underscore). Single underscore or missing version number will be ignored.
fix
Use format like 001__my_migration.cql. Ensure files are in the exact migrationsDir folder.
affects: >=0.0.0
gotchaCQL statements within a file must be separated by exactly three hyphens '---' on their own line.
fix
Separate each CQL statement with a line containing only '---'.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'cassandra-driver'
Missing dependency cassandra-driver.
fix
Run npm install --save cassandra-driver alongside scylla-migration.
Error: Keyspace 'mykeyspace' does not exist
Keyspace specified in config does not exist.
fix
Create keyspace manually: CREATE KEYSPACE mykeyspace WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
Upgrade
Version history
2.4.4latest on npm
Audit
Dependencies
cassandra-driverrequiredRequired to connect to ScyllaDB/Cassandra. Must be installed separately.
Agent activity
13 hits · last 30 days
node
10
Meta
2
Resources
scylla-migration — npm install scylla-migration · libregistry