{"id":49309,"library":"seqmig","title":"SeqMig","description":"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.","status":"active","version":"2.0.3","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","sequelize","migration","auto-migration","cli","database","typescript"],"install":[{"cmd":"npm install seqmig","lang":"bash","label":"npm"},{"cmd":"yarn add seqmig","lang":"bash","label":"yarn"},{"cmd":"pnpm add seqmig","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: seqmig works with Sequelize ORM (v5/v6/v7) for model introspection and migration generation.","package":"sequelize","optional":false},{"reason":"Optional peer dependency: needed if using TypeScript decorators (@Column, @Table) for model introspection.","package":"sequelize-typescript","optional":true}],"imports":[{"note":"Prefer npx to avoid global install; global install works but may cause version conflicts.","wrong":"npm install -g seqmig","symbol":"SeqMig CLI","correct":"npx seqmig init"},{"note":"SeqMig expects JavaScript config file, not JSON; paths must be absolute or relative to project root.","wrong":"{ config: './config.json' }","symbol":".sequelizerc","correct":"module.exports = { config: './config/config.js', 'models-path': './models', 'migrations-path': './migrations' }"},{"note":"The --name flag expects a slug without spaces; -n shorthand is also available.","wrong":"seqmig generate --name add-users-table","symbol":"seqmig generate","correct":"seqmig generate -n add-users-table"}],"quickstart":{"code":"// Initialize seqmig (creates .sequelizerc)\nnpx seqmig init\n\n// Rebuild snapshot from current models (run after model changes)\nnpx seqmig rebuild\n\n// Preview migration actions before generating\nnpx seqmig preview\n\n// Generate migration for changes (e.g., new table)\nnpx seqmig generate -n add-users\n\n// Run pending migrations\nnpx seqmig run","lang":"typescript","description":"This quickstart shows the CLI commands to initialize seqmig, rebuild the schema snapshot, preview changes, generate a migration, and apply it."},"warnings":[{"fix":"Explicitly set allowNull on every @Column decorator (true or false) to match intended behavior.","message":"v2.0.0: Strict nullability defaults: if allowNull is not explicitly set, columns are treated as allowNull: false.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Explicitly set onDelete/onUpdate on associations or model references to control cascade behavior.","message":"v2.0.0: Foreign key onDelete/onUpdate default changed to 'CASCADE' if not explicitly set.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Ensure .sequelizerc exports a JS object, not a JSON file.","message":"seqmig uses .sequelizerc in JavaScript format (module.exports = { ... }). JSON configuration is not supported.","severity":"gotcha","affected_versions":"*"},{"fix":"Always mark non-persistent fields as DataType.VIRTUAL to avoid snapshot noise.","message":"DataType.VIRTUAL fields are excluded from migrations but may appear in snapshot if introspected.","severity":"gotcha","affected_versions":"*"},{"fix":"Upgrade Sequelize to v5, v6, or v7.","message":"seqmig v2.x drops support for Sequelize v4 (use v5+).","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'2.0.3':19 'auto':9,50,65 'auto-gener':49 'auto-migr':8,64 'base':7 'cleanup':55 'cli':11,39,67 'databas':68 'default':46 'diff':24 'differenti':37 'enum':54 'explicit':53 'fk':47 'generat':32,51 'index':48 'introspect':21 'javascript':61 'key':36 'local':28 'migrat':10,35,63,66 'model':23 'month':59 'nullabl':45 'overhead':43 'pure':38 'regular':56 'releas':60 'runtim':42 'schema':29 'seqmig':1,2 'sequel':13,16,34,62 'sequelize-typescript':15 'snapshot':6,30 'snapshot-bas':5 'strict':44 'transact':33 'typescript':17,69 'updat':57 'version':18 'workflow':40","created_at":"2026-06-07T17:01:06.418029+00:00","updated_at":"2026-06-07T17:01:06.418029+00:00","problems":[{"fix":"Run 'npx seqmig init' to create default .sequelizerc, or create it manually with configuration.","cause":"SeqMig requires a .sequelizerc configuration file not present in project root.","error":"ENOENT: no such file or directory, open '.sequelizerc'"},{"fix":"Run 'npm install sequelize' to install Sequelize.","cause":"Sequelize is not installed as a peer dependency.","error":"Cannot find module 'sequelize'"},{"fix":"Use 'const User = require('./models/user')' or ES6 static models instead of sequelize.import().","cause":"Using Sequelize v6+ which removed sequelize.import; model import pattern changed.","error":"TypeError: sequelize.import is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"seqmig","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}