Easy migration tool for MySQL, Postgres, and SQLite databases. Current version 0.1.5. Migy offers a simple SQL-file-based migration system with rollback support, migration hashing for integrity verification, and works both as a standalone CLI and as part of an application. It supports popular database adapters (mysql2, postgres, sqlite3) and can be extended with custom adapters. Migrations are stored as .sql files with IDE-friendly syntax highlighting and support multiple queries per migration. Compared to alternatives like knex or db-migrate, migy is minimal and SQL-centric, without requiring a migration DSL or JavaScript-based migration definitions.
npm install migyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to set up migy as a standalone CLI tool with MySQL2.
Rename migration files to start with a number.
Use ### separator without surrounding quotes.
Use ### DOWN or ### ROLLBACK as a separate line.
Use await migy.init() or .then().
Use 'mysql2', 'postgres', or 'sqlite3' exactly.
Consider using custom adapter functions if extending.
Use const migy = require('migy') (CommonJS).Run npm install mysql2 (or pg, sqlite3) in the project.
Create the directory and place .sql files inside.
Rename file to start with digits (e.g., '01_abc.sql').
First migration run will create it automatically; ensure permissions.