A migration tool for anydb-sql, providing up/down migration functions with transaction support. The current stable version is 2.4.1. It is a lightweight, synchronous-style migration runner that operates within database transactions, allowing safe rollbacks. It includes CLI commands for checking and executing pending migrations, with an option for silent mode. It ships TypeScript definitions and is intended for use with anydb-sql databases.
npm install anydb-sql-migrationsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up a migration script using anydb-sql and anydb-sql-migrations, including database connection and migration execution.
Ensure the second argument to create() is a valid path to a directory containing .js files with exports.up and exports.down.
Use the provided transaction object for all database operations inside up/down functions.
Consider migrating to a more actively maintained migration framework.
const migration = require('anydb-sql-migrations').create(db, dir); migration.run();Ensure the second argument to create() points to the correct directory containing migration files.
Use the transaction parameter inside exports.up = function(t) { t.queryAsync('...'); }