Minimal raw SQL migration runner for Node.js that supports PostgreSQL and MySQL. Version 1.0.5 (last release appears to be 2018) is a low-activity library focused on raw SQL files and a simple CLI. Unlike Knex or Sequelize migrations, this library has zero ORM dependencies and uses plain SQL files with up/down pairs. It provides programmatic API (migrate, rollback, create) with promise support, configurable logger, optional SQL parameter substitution, and min migration timestamp filtering. Lacks built-in seeding or advanced features; maintained but no recent updates.
npm install sql-migrations-nodeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic setup using CommonJS require with environment variables for config and adapter selection.
Use require() instead of import.
npm install pg or npm install mysql alongside sql-migrations.
Create the database manually before running migrations.
Consider using an actively maintained migration tool like node-pg-migrate or Knex.
Use path.resolve(__dirname, 'migrations') instead of a relative string.
Use const { run } = require('sql-migrations');Run: npm install pg
Ensure the first migration SQL creates the 'migrations' table as per docs (or manually create it).