Registry / database / iplayabc-db-migration

iplayabc-db-migration

JSON →
library3.0.8jsnpmunverified

MySQL database migration tool based on Umzug v3.x. Current stable version is 3.0.8. It supports MySQL Named Lock for cluster-safe migrations, file integrity verification with hash checking, transaction support per migration, nested directory structures, and relative path storage. Differentiators include built-in cluster safety via MySQL locks and hash-based file integrity, which are often missing in simpler migration tools. The package requires Umzug v3 and mysql2.

npm install iplayabc-db-migration
INSTALL
IMPORT
SIG · IPLAYABC-DB-MIGRAT
I
iplayabc-db-migration
databasejavascriptv3.0.8
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.

migrate
const { migrate } = require('iplayabc-db-migration');
import { migrate } from 'iplayabc-db-migration';
Package uses CommonJS; ESM import may not work without transpilation.
migrateWithConfig
const { migrateWithConfig } = require('iplayabc-db-migration');
Same as migrate, but accepts config object instead of file path.
createUmzugInstance
const { createUmzugInstance } = require('iplayabc-db-migration/src/umzug-mysql');
const { createUmzugInstance } = require('iplayabc-db-migration');
This is an internal module; import path includes 'src/umzug-mysql'.

Shows basic usage: define DB config in a file, then call migrate with the config path.

// config.js exports.db = { host: 'localhost', user: 'root', password: process.env.DB_PASSWORD ?? '', database: 'mydb', charset: 'utf8mb4' }; // app.js const { migrate } = require('iplayabc-db-migration'); async function run() { await migrate('./config.js'); console.log('Migrations completed'); } run().catch(console.error);
Debug
Known issues
gotchaThe package expects migration files in 'db-migration/migrations/' directory relative to process.cwd().
fix
Ensure your migration files are placed in the correct directory structure.
affects: >=3.0.0
gotchaUsing createUmzugInstance requires importing from an internal path ('src/umzug-mysql') that may change without notice.
fix
Prefer using 'migrate' or 'migrateWithConfig' unless you specifically need Umzug instance.
affects: >=3.0.0
deprecatedThe package uses Umzug v3 which is outdated; Umzug v4+ is available.
fix
Consider using a more recent migration tool or update to newer Umzug if possible.
affects: >=3.0.0
Errors
Common errors & fixes
Cannot find module 'iplayabc-db-migration'
Package not installed or not available in node_modules.
fix
Run 'npm install iplayabc-db-migration' from the project root.
ENOENT: no such file or directory, open 'db-migration/migrations/...'
Migration directory does not exist relative to current working directory.
fix
Create 'db-migration/migrations/' directory and place SQL files there.
Upgrade
Version history
3.0.8latest on npm
Audit
Dependencies
umzugrequiredCore migration engine used under the hood.
mysql2requiredRequired for database connection.
Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
iplayabc-db-migration — npm install iplayabc-db-migration · libregistry