Registry / database / db-migrate-diff

db-migrate-diff

JSON →
library0.3.5jsnpmunverified

A module for detecting differences between database states and migration files, designed to work with db-migrate. Version 0.3.5 (latest) provides CLI tools to compare applied migrations against pending ones, helping identify missing migrations or drift. It supports multiple reporters (default, ghost) and environments (dev, production). Unlike db-migrate's built-in diff, it offers explicit detection and reporting. Release cadence is low; no updates since 2017.

npm install db-migrate-diff
INSTALL
IMPORT
SIG · DB-MIGRATE-DIFF
D
db-migrate-diff
databasejavascriptv0.3.5
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.

db-migrate-diff
npx db-migrate-diff
npm install -g db-migrate-diff && db-migrate-diff
Use npx or add as devDependency and run via npm scripts.

Shows how to install and run db-migrate-diff with various options, including environment and reporter flags.

// Install npm install db-migrate-diff --save-dev // Run with default environment (dev) npx db-migrate-diff // Specify environment and migration directory db-migrate-diff -e production -m ./migrations --config ./database.json // Use ghost reporter to show migrations not in database db-migrate-diff -r ghost
Debug
Known issues
gotchaRequires a MySQL database (no other DBs supported).
fix
Use db-migrate with MySQL or ensure your database is MySQL-compatible.
affects: *
gotchaAssumes database.json in current directory; misconfiguration causes cryptic errors.
fix
Use --config flag to specify the exact path to database.json.
affects: *
deprecatedPackage has not been updated since 2017; may have compatibility issues with newer db-migrate versions.
fix
Test with your db-migrate version; consider forking or using db-migrate's built-in diff if available.
affects: >=0.3.5
Errors
Common errors & fixes
Error: Cannot find module 'db-migrate'
db-migrate is not installed or not in node_modules.
fix
Run 'npm install db-migrate --save-dev' to install db-migrate as a dependency.
Error: No database configuration found.
database.json file is missing or not in the expected location.
fix
Create a database.json file in your project root or use the --config flag to specify its path.
Error: ENOTFOUND localhost
MySQL server is not running or hostname is incorrect.
fix
Ensure MySQL is running and accessible; check the host in database.json.
Upgrade
Version history
0.3.5latest on npm
Audit
Dependencies
db-migraterequiredCore migration framework; this package detects differences for db-migrate
Agent activity
7 hits · last 30 days
node
6
Resources
db-migrate-diff — npm install db-migrate-diff · libregistry