Registry / database / seqmig

seqmig

JSON →
library2.0.3jsnpmunverified

seqmig is a snapshot-based auto-migration CLI for Sequelize and sequelize-typescript, version 2.0.3. It introspects your models, diffs them against a local schema snapshot, and generates transactional Sequelize migrations. Key differentiators: pure CLI workflow (no runtime overhead), strict nullability defaults, FK index auto-generation, and explicit ENUM cleanup. Regularly updated with monthly releases.

npm install seqmig
INSTALL
IMPORT
SIG · SEQMIG
S
seqmig
databasejavascriptv2.0.3
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.

SeqMig CLI
npx seqmig init
npm install -g seqmig
Prefer npx to avoid global install; global install works but may cause version conflicts.
.sequelizerc
module.exports = { config: './config/config.js', 'models-path': './models', 'migrations-path': './migrations' }
{ config: './config.json' }
SeqMig expects JavaScript config file, not JSON; paths must be absolute or relative to project root.
seqmig generate
seqmig generate -n add-users-table
seqmig generate --name add-users-table
The --name flag expects a slug without spaces; -n shorthand is also available.

This quickstart shows the CLI commands to initialize seqmig, rebuild the schema snapshot, preview changes, generate a migration, and apply it.

// Initialize seqmig (creates .sequelizerc) npx seqmig init // Rebuild snapshot from current models (run after model changes) npx seqmig rebuild // Preview migration actions before generating npx seqmig preview // Generate migration for changes (e.g., new table) npx seqmig generate -n add-users // Run pending migrations npx seqmig run
Debug
Known issues
breakingv2.0.0: Strict nullability defaults: if allowNull is not explicitly set, columns are treated as allowNull: false.
fix
Explicitly set allowNull on every @Column decorator (true or false) to match intended behavior.
affects: >=2.0.0
breakingv2.0.0: Foreign key onDelete/onUpdate default changed to 'CASCADE' if not explicitly set.
fix
Explicitly set onDelete/onUpdate on associations or model references to control cascade behavior.
affects: >=2.0.0
gotchaseqmig uses .sequelizerc in JavaScript format (module.exports = { ... }). JSON configuration is not supported.
fix
Ensure .sequelizerc exports a JS object, not a JSON file.
affects: *
gotchaDataType.VIRTUAL fields are excluded from migrations but may appear in snapshot if introspected.
fix
Always mark non-persistent fields as DataType.VIRTUAL to avoid snapshot noise.
affects: *
deprecatedseqmig v2.x drops support for Sequelize v4 (use v5+).
fix
Upgrade Sequelize to v5, v6, or v7.
affects: >=2.0.0
Errors
Common errors & fixes
ENOENT: no such file or directory, open '.sequelizerc'
SeqMig requires a .sequelizerc configuration file not present in project root.
fix
Run 'npx seqmig init' to create default .sequelizerc, or create it manually with configuration.
Cannot find module 'sequelize'
Sequelize is not installed as a peer dependency.
fix
Run 'npm install sequelize' to install Sequelize.
TypeError: sequelize.import is not a function
Using Sequelize v6+ which removed sequelize.import; model import pattern changed.
fix
Use 'const User = require('./models/user')' or ES6 static models instead of sequelize.import().
Upgrade
Version history
2.0.3latest on npm
Audit
Dependencies
sequelizerequiredPeer dependency: seqmig works with Sequelize ORM (v5/v6/v7) for model introspection and migration generation.
sequelize-typescriptoptionalOptional peer dependency: needed if using TypeScript decorators (@Column, @Table) for model introspection.
Agent activity
17 hits · last 30 days
node
16
Meta
1
Resources
packageseqmig
seqmig — npm install seqmig · libregistry