Registry / database / migration

migration

JSON →
library0.3.0jsnpmunverified

Migration is a Node.js framework for managing database schema migrations using JavaScript files. It supports running migrations up or down to specific timestamps, and includes features like compiler support for JS preprocessors and environment flags. Based on TJ's node-migrate, it differentiates itself by using timestamps instead of sequence numbers, and supports custom compilers via the --compiler flag. Version 0.3.0 is stable with infrequent updates; compatible with Node >=0.8.0 and npm >=1.2.10. It stores migration state in a hidden file and is ideal for projects needing simple, file-based migration management.

npm install migration
INSTALL
IMPORT
SIG · MIGRATION
M
migration
databasejavascriptv0.3.0
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.

migration (CLI)
npx migrate create my-migration
npm run migrate
The library is primarily used via CLI; there is no programmatic API.

Shows how to install, create a migration file with up/down functions, and run migrations via CLI.

# Install globally or locally npm install migration # Create a migration file npx migrate create add-users # Edit ./migrations/<timestamp>-add-users.js exports.up = function(next) { // Apply migration (e.g., create a table) next(); }; exports.down = function(next) { // Rollback migration (e.g., drop the table) next(); }; # Run all pending migrations npx migrate up # Rollback last migration npx migrate down <timestamp>
Debug
Known issues
gotchaMigration state is stored in a hidden file ./.migrate, which should be added to .gitignore to avoid conflicts.
fix
Add '.migrate' to your .gitignore file.
affects: >=0.0.1
deprecatedPackage is based on an older fork; consider using more modern alternatives like node-pg-migrate or db-migrate for active development.
fix
Evaluate migration tools compatible with your database.
affects: >=0.0.1
gotchaCLI command 'migrate' may conflict with other packages that use the same binary name.
fix
Use npx migrate or install globally with a specific name.
affects: >=0.0.1
Errors
Common errors & fixes
Error: Cannot find module './migrations/.migrate'
Missing migration state file when first running migrations.
fix
Create the migrations directory and run 'migrate up' to generate the state file automatically.
migrate: command not found
The package is not installed globally or not in PATH.
fix
Install globally: npm install -g migration, or use npx: npx migrate up
Upgrade
Version history
0.3.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
6
Amazon
1
Resources
migration — npm install migration · libregistry