Run Prisma migrations in code without the CLI. This package is created for the this Prisma issue.
This package is not a replacement for the Prisma CLI. Currently, this package only supports MySQL. Also rollbacks are currently not yet supported.
I am building applications that are going to be deployed to environments where I don't have access to the Prisma CLI. Which is why I created this package, to be able to run migrations in code.
- Get migrations that have not been applied
- Run any migrations for the prisma database
npm install prisma-migrations-runnerimport { PrismaClient } from "@prisma/client";
import { runMigrations } from "prisma-migrations-runner";
const prisma = new PrismaClient();
await runMigrations(prisma);MIT