Registry / database / sequelize-auto-migration

sequelize-auto-migration

JSON →
library0.0.7jsnpmunverified

An auto-migration and seeder tool for ElectronJs and Node.js applications using Sequelize ORM with relational databases (MSSQL, PostgreSQL, SQLite3). Version 0.0.7 (latest) provides a simple API to automate schema migration and seeding by passing a Sequelize instance and file paths. It stores completed migrations in SequelizeMeta table and seeders in SequelizeData, mirroring sequelize-cli. The tool is lightweight and integrates with Electron's main process, but lacks active maintenance—last updated in 2020, with unaddressed issues and no TypeScript support. Compared to sequelize-cli, it offers a programmatic alternative without CLI commands.

npm install sequelize-auto-migration
INSTALL
IMPORT
SIG · SEQUELIZE-AUTO-MIG
S
sequelize-auto-migration
databasejavascriptv0.0.7
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.

default
✓ const SequelizeAuto = require('sequelize-auto-migration')(models);
✗ import SequelizeAuto from 'sequelize-auto-migration';
Package exports a function that takes the models object and returns an instance. ESM import will fail; it is CJS-only.
config
✓ await SequelizeAuto.config({ migrationPath: './migrations', seedPath: './seeders' });
✗ SequelizeAuto.config({ migrationPath: './migrations' });
config() is async and must be awaited. Returns a promise.
migrate
✓ SequelizeAuto.migrate(callback);
✗ const result = await SequelizeAuto.migrate();
migrate() uses callback pattern; does not return a promise. Use async.waterfall or promisify.

Shows basic usage: import with models, configure paths, run migration and seeding using callbacks.

const Sequelize = require('sequelize'); const models = require('./models'); const SequelizeAuto = require('sequelize-auto-migration')(models); const path = require('path'); async function runMigration() { await SequelizeAuto.config({ migrationPath: path.resolve('./migrations'), seedPath: path.resolve('./seeders') }); SequelizeAuto.migrate(function(err, result) { if (err) { console.log('Migration error:', err); } else { console.log('Migration successful'); SequelizeAuto.migrationSeed(function(err, result) { if (err) { console.log('Seed error:', err); } else { console.log('All migrations and seeds completed'); } }); } }); } runMigration().catch(console.error);
Debug
Known issues
deprecatedPackage last updated in 2020, no recent commits, issues unaddressed.
fix
Consider using sequelize-cli or other maintained migration tools.
affects: >=0.0.0
gotchaRequires 'async' package for proper callback handling; migrate() does not return a promise.
fix
Wrap in a promise or use async.waterfall as shown in examples.
affects: >=0.0.0
gotchaNamed exports are not available; must invoke the default export as a function with models object.
fix
Use 'const SequelizeAuto = require('sequelize-auto-migration')(models);'
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'sequelize-auto-migration'
Package not installed or missing from node_modules.
fix
Run 'npm install sequelize-auto-migration'
SequelizeAuto.config is not a function
Default import used incorrectly; missing function call with models.
fix
Use: const SequelizeAuto = require('sequelize-auto-migration')(models);
sequelize is not defined
Sequelize instance not passed or models not properly initialized.
fix
Ensure models object contains Sequelize instance with defined models.
Upgrade
Version history
0.0.7latest on npm
Audit
Dependencies
sequelizerequiredPeer dependency for database ORM operations
asyncrequiredUsed for control flow (e.g., async.waterfall)
Agent activity
12 hits · last 30 days
node
10
Resources
sequelize-auto-migration — npm install sequelize-auto-migration · libregistry