knex-migration-with-schema
JSON →A utility library for Knex.js (v2.0.0) that simplifies running database migrations across multiple schemas. While Knex supports per-query schema references via `withSchema()`, its built-in `knex.migrate` API lacks native multi-schema support. This library fills that gap by providing `createSchema`, `executeSchemaMigration`, and `executeSchemaMigrationFromDir` functions. It accepts a Knex instance, schema name, and a dictionary of migration objects or a directory of migration files, executing only pending migrations per schema. Released under MIT, actively maintained on GitHub. Key differentiator: enables programmatic schema-scoped migrations without manual schema tracking or external orchestration.
Resources
packageknex-migration-with-schema ↗