Dana is a simple, small, and framework-agnostic database schema migration CLI for Node.js, currently supporting MySQL only. It auto-generates migration files by tracking changes in user-defined model files (JavaScript objects describing tables), similar to how Git tracks file changes. Version 1.0.0 is current; no frequent releases reported. Key differentiators: no API to learn (models are plain JS objects), migrations are YAML-based with embedded SQL, built-in rollback support, and model validation before migration generation. Unlike Rails or Knex migrations, users never write migration code manually — dana produces diff-based migration files from model changes.
npm install danaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic dana workflow: install, initialize, create a model file, generate migration, run, and rollback.
Use a different tool if you need multi-DB support (e.g., knex, db-migrate).
Always include a unique `_fid` value (e.g., a short UUID or random string) in each model file.
Avoid using those column types; manually edit generated SQL if needed.
Consider using an actively maintained migration tool like knex or db-migrate.
Use CommonJS (`module.exports = {...}`) when defining models.Install globally: `npm install -g dana` or use `npx dana`
Use `sudo npm install -g dana` or install locally with `npm install --save-dev dana` and run via npx
Review generated YAML migration file and manually correct SQL for any unsupported data types (e.g., JSON, spatial)
Set correct models path in .danarc or ensure models exist in the default ./models directory