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 seqmigNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
This quickstart shows the CLI commands to initialize seqmig, rebuild the schema snapshot, preview changes, generate a migration, and apply it.
Explicitly set allowNull on every @Column decorator (true or false) to match intended behavior.
Explicitly set onDelete/onUpdate on associations or model references to control cascade behavior.
Ensure .sequelizerc exports a JS object, not a JSON file.
Always mark non-persistent fields as DataType.VIRTUAL to avoid snapshot noise.
Upgrade Sequelize to v5, v6, or v7.
Run 'npx seqmig init' to create default .sequelizerc, or create it manually with configuration.
Run 'npm install sequelize' to install Sequelize.
Use 'const User = require('./models/user')' or ES6 static models instead of sequelize.import().