A utility wizard that replaces Prisma's migration engine with Knex, allowing developers to use Prisma as ORM while leveraging Knex's migration engine for running migrations. Version 0.0.40 is the latest, with irregular release cadence. Key differentiator: combines Prisma's schema and DDL auto-generation with Knex's programmatic migration capabilities, enabling data migrations and more control over migration execution. Currently in early development, tested mainly with PostgreSQL, with limited support for MySQL 8.x. Includes a setup script that configures Knex, creates sync scripts, and adds npm scripts for migration generation and application. Not recommended for production use.
npm install prisma-migration-migratorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows the complete setup workflow: install dependencies, run the npx wizard, sync migrations, generate new ones, and apply them.
Always use npx to ensure you get the latest version: npx prisma-migration-migrator
Before switching back to Prisma migrations, manually remove the added models from schema.prisma and reset the migration history.
Stick to PostgreSQL if you need full DDL generation support. For other databases, manually write DDL in Knex migrations.
Do not use in production. Consider alternatives like Prisma's native migrations or using Knex exclusively if you need programmatic migrations.
Back up your existing knexfile.mjs before running the setup. Use --force to overwrite if needed.
Run npm install knex in your project before calling the migrator.
Delete or rename the existing knexfile.mjs, or run the command with --force: npx prisma-migration-migrator -- --force
Run migration:sync again after ensuring all Prisma migrations are applied. You can manually sync by marking existing migrations as applied via knex migrate:make and then manually inserting records into the Knex migration table.