UNPKG

prisma-migration-migrator

Version:

Replace Prisma as the migration engine with Knex, while keeping it as ORM

16 lines 682 B
import { knexMigrationWriter } from 'prisma-diff-to-knex-migration'; export async function knexMigrationsWriter(migrations) { if (!migrations.length) { console.log('> No migrations to convert - Skipping conversion'); return; } try { const converted = await Promise.all(migrations.map(({ sql, finalMigrationPath }) => knexMigrationWriter(sql, finalMigrationPath))); console.log(`> Successfully converted ${converted.length} Prisma migrations to Knex migrations`); } catch (err) { console.error('> Error converting migration', { migrations }, err); throw err; } } //# sourceMappingURL=knexMigrationsWriter.js.map