# Upgrade PostgreSQL Apps from Prisma 6 or 7 to 8

Prisma upgrades can change query behavior, migration history, and build workflows. This skill guides schema adoption, client rewrites, and before-and-after verification for PostgreSQL applications.

## Install

```bash
npx skillstore add prisma/prisma-postgres-upgrade
```

## Metadata

- Status: approved
- Slug: prisma-prisma-postgres-upgrade
- Version: 2.0.0
- Author version: 2.0.0
- Skillstore revision: r1
- Version status: valid
- Tree hash: a07071fd4036ffe34dd089d776d2a30676b8fadfa6b9efdd8eff0fdfb0d5ff54
- Author: prisma
- GitHub username: prisma
- License: MIT
- Repository: https://github.com/prisma/skills/tree/a6f192959cf43b08aa330fe1ffca090267215812/prisma-postgres-upgrade
- Ref: ad8be71d26a1c3f9372143d565ab4c05f6cd2940
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: env\_access, external\_commands, network, filesystem
- Quality score: 71
- Public page: https://skillstore.pages.dev/skills/prisma-prisma-postgres-upgrade
- Manifest: https://skillstore.pages.dev/api/skills/prisma-prisma-postgres-upgrade/manifest

## Capabilities

- Provides a direct Prisma ORM 6 or 7 upgrade workflow that retains the existing PostgreSQL schema and database.
- Shows configuration for reading schema.prisma through prisma7Schema and emitting contract artifacts.
- Explains database signing, baseline migration planning, and retirement of the legacy migration setup.
- Maps common client queries, relation counts, unique lookups, enums, and seed-client usage to the new API.
- Highlights CommonJS configuration, date representation, database time zones, and template changes that affect query rewrites.
- Defines before-and-after repository checks, fresh-install verification, and explicit reporting of unverified behavior.

## Use Cases

- Modernize an existing application: Upgrade a PostgreSQL application while retaining its schema and comparing repository checks before and after client rewrites.
- Prepare a Compute deployment: Complete the documented ORM upgrade and confirm compatible dependency versions before handing deployment to a separate skill.
- Review upgrade behavior: Inspect relation counts, unique lookups, date handling, and template changes, then identify gaps that existing checks cannot verify.

## Prompt Templates

### Assess upgrade readiness

```
Review this PostgreSQL app for a Prisma ORM 6 or 7 upgrade to Prisma 8. Identify prerequisites, existing checks, and questions before changing files.
```

### Plan schema adoption

```
Plan configuration and baseline migration changes while retaining schema.prisma. Require successful baseline verification, a recoverable archive, and my confirmation before deleting migration history.
```

### Rewrite client usage

```
Map this application's Prisma client calls to the documented Prisma 8 API. Include templates, seeds, counts, unique lookups, and date handling. Preserve current behavior.
```

### Execute and verify the upgrade

```
Upgrade this PostgreSQL app using environment-compatible pinned versions and reviewed companion skills. Compare existing checks before and after. Preserve recoverable migrations and report unverified behavior.
```

## Limitations

- Covers PostgreSQL upgrades only, not MongoDB, new projects, incremental coexistence, or deployment execution.
- Requires separately synced Prisma skills for detailed version-specific contracts, queries, and migration commands.
- Example release-candidate versions are source-specific and require compatibility confirmation for the target environment.
- Does not add missing tests or establish a backup workflow; users must protect migration history and review unverified behavior.

## Best Practices

- Confirm compatible exact package versions and review synced companion skills before following their version-specific instructions.
- Keep recoverable migration history and require successful baseline verification and explicit confirmation before deleting legacy files.
- Run identical existing checks before and after, then report time-zone decisions and unverified runtime behavior.

## Anti Patterns

- Installing unpinned latest dependencies without checking compatibility with the intended deployment environment.
- Deleting legacy migrations after a failed baseline command or without preserving a recoverable copy.
- Treating a successful type check as proof that templates, dates, and relation counts retain their previous behavior.

## Security Audit

- Audited at: 2026-11-10T16:01:17.902\+00:00
- Summary: All 64 static matches are false positives involving Markdown syntax, intended database configuration, documentation links, and generated-client cleanup. One semantic concern remains: the example deletes legacy migrations even when the preceding baseline command chain fails. No evidence found of credential exfiltration, malicious command execution, or prompt injection in the four reviewed files.

## Stats

- Views: 0
- Downloads: 0
- Favorites: 0
- Popularity score: 0
