Skip to content

Prisma

Prisma’s migrate diff can render a script from an empty source to the current declarative schema.

Terminal window
pnpm exec prisma migrate diff \
--from-empty \
--to-schema ./prisma/schema.prisma \
--script

Connect that deterministic stdout stream directly:

[targets.app]
schema_command = [
"pnpm", "exec", "prisma", "migrate", "diff",
"--from-empty",
"--to-schema", "./prisma/schema.prisma",
"--script"
]
dev_database_env = "ONWARDPG_DEV_DATABASE_URL"
scratch_database_env = "ONWARDPG_SCRATCH_DATABASE_URL"
dev_mode = "workspace"

Run onwardpg config check whenever Prisma or its engines change. Native type annotations matter: for example, Prisma String may map to different PostgreSQL types depending on the schema declaration.

Prisma Schema Language does not represent every PostgreSQL feature. If your application relies on custom functions, triggers, extensions, or other SQL, wrap the command in a script that appends their deterministic full definitions.