@povio/prisma-pg-migrate
v0.1.0
Published
Lightweight Prisma-compatible PostgreSQL production migration runner
Downloads
660
Keywords
Readme
@povio/prisma-pg-migrate
A lightweight PostgreSQL production runner for migration histories created by Prisma Migrate. It applies existing
prisma/migrations/*/migration.sql files and maintains Prisma's _prisma_migrations ledger without shipping the
Prisma CLI or schema engines in the production image.
CLI
DATABASE_URL=postgresql://user:password@host/database \
prisma-pg-migrate deploy --migrations-path prisma/migrationsThe migration path defaults to prisma/migrations. Keep Prisma installed as development and recovery tooling for
creating migrations and running commands such as prisma migrate resolve.
Library
import { runPrismaCompatibleMigrations } from "@povio/prisma-pg-migrate";
await runPrismaCompatibleMigrations({
databaseUrl: process.env.DATABASE_URL!,
migrationsPath: "./prisma/migrations",
});Compatibility and limitations
- PostgreSQL only.
- Uses Prisma-compatible SHA-256 checksums and advisory locking.
- Blocks when the ledger contains an unfinished migration.
- Uses PostgreSQL-aware statement parsing, including dollar-quoted bodies and
CREATE INDEX CONCURRENTLY. - Does not replace Prisma's development commands or recovery workflow.
