Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .claude/skills/docs-writer/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If a rule here conflicts with house style, follow the house style and flag the c

For a step-by-step example of writing each kind of page (how-to, concept, reference) and rewriting an existing one, see `references/how-to-use.md`.

For a Prisma 8 docs page or section (anything under `content/docs/orm/v8/` or `content/docs/(index)/next/`), also read `references/prisma-8.md`: page location, redirect handling (commented out until the URL cutover), tested-example requirements, tab and diagram conventions, and naming rules.
For a Prisma 8 docs page or section (anything under `content/docs/orm/` outside `v6/` and `v7/`, or the Prisma 8 getting-started pages under `content/docs/(index)/`), also read `references/prisma-8.md`: page location, redirect handling (commented out until the URL cutover), tested-example requirements, tab and diagram conventions, and naming rules.

## Foundation

Expand Down
12 changes: 6 additions & 6 deletions .claude/skills/docs-writer/references/prisma-8.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ Follow these when writing or reviewing a Prisma 8 docs section in `apps/docs` (t

## Where pages live

- Concept and task docs go in the ORM "Next" version tree: `content/docs/orm/v8/<section>/` served at `/docs/orm/v8/<section>/<slug>`. The version dropdown keys off the `/orm/v8/*` path.
- Getting-started funnel pages stay under `content/docs/(index)/next/`.
- Frontmatter `url` must mirror the file path. Register the section in `content/docs/orm/v8/meta.json`.
- Prisma 8 is the default docs version. Concept and task docs go in the unversioned ORM tree: `content/docs/orm/<section>/` served at `/docs/orm/<section>/<slug>`. Prisma 7 docs live under `content/docs/orm/v7/` (and `(index)/v7/`, `cli/v7/`, `guides/v7/`). The version dropdown keys off the `/orm/v7/*` path.
- Getting-started funnel pages live under `content/docs/(index)/` (`getting-started.mdx`, `prisma-orm/`, `prisma-postgres/`).
- Frontmatter `url` must mirror the file path. Register the section in `content/docs/orm/meta.json`.

## Redirects: commented out until the cutover

Do not add live Prisma 7 → Prisma 8 redirects yet. They retire live URLs, and they ship together when the `/orm/v8` tree becomes `/orm` (DR-8687).
The Prisma 7 → Prisma 8 URL cutover (DR-8687) has shipped: `/orm/v8` is now `/orm`, and the Prisma 7 tree moved to `/orm/v7`. Add redirects for any further page move in the live region of `next.config.mjs` `redirects()`.

Instead, append your section's redirect map to the commented block in `apps/docs/v8.config.mjs` (search for "Prisma 8 URL cutover"). Keep the entries commented, one per line, `permanent: false`, with your DR reference. Pages with no Prisma 8 equivalent stay live on the Prisma 7 tree; list them in the same comment block for the SEO owner.
Prefer page-to-page redirects; the cutover block in `next.config.mjs` (search for "Prisma 8 URL cutover") is the reference for the shape. Keep the entries commented, one per line, `permanent: false`, with your DR reference. Pages with no Prisma 8 equivalent stay live on the Prisma 7 tree; list them in the same comment block for the SEO owner.

## Accuracy: test before you write

Expand All @@ -37,4 +37,4 @@ Every code sample must be executed against the published `@prisma/orm-*` package

- The product is "Prisma 8", not "Prisma 8 ORM". The high-level query lane is "the ORM API"; the low-level lanes are "the SQL query builder" and "the pipeline builder".
- No em dashes. Be honest about Release Candidate status; state limitations in user-facing language ("X is not supported yet. For now, do Y") and show the tested workaround.
- Validate with `pnpm --filter docs types:check`, `pnpm lint:links`, `pnpm exec cspell --no-progress "content/docs/orm/v8/**/*.mdx"` (use placeholder ids in result blocks; random cuid fragments fail cspell), and a dev-server smoke test.
- Validate with `pnpm --filter docs types:check`, `pnpm lint:links`, `pnpm exec cspell --no-progress "content/docs/orm/**/*.mdx"` (use placeholder ids in result blocks; random cuid fragments fail cspell), and a dev-server smoke test.
6 changes: 3 additions & 3 deletions .github/workflows/error-reference-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Error Reference Check

# The published error-reference page must list every structured error code the
# product (prisma/prisma main) can emit — each emitted error links to
# /docs/orm/v8/reference/error-reference#<CODE>. This check fails if any
# /docs/orm/reference/error-reference#<CODE>. This check fails if any
# known code is missing from the page, even if the sync workflow breaks.
#
# Runs on pushes to main, on PRs that touch the page or its tooling, and on a
Expand All @@ -14,7 +14,7 @@ on:
branches: [main]
pull_request:
paths:
- apps/docs/content/docs/orm/v8/reference/error-reference.mdx
- apps/docs/content/docs/orm/reference/error-reference.mdx
- apps/docs/scripts/generate-error-reference.mjs
- .github/workflows/error-reference-check.yml
- .github/workflows/sync-error-reference-docs.yml
Expand Down Expand Up @@ -49,4 +49,4 @@ jobs:
node-version: "20"

- name: Verify page lists every known error code
run: node prisma-src/scripts/list-error-codes.mjs --root prisma-src --verify apps/docs/content/docs/orm/v8/reference/error-reference.mdx
run: node prisma-src/scripts/list-error-codes.mjs --root prisma-src --verify apps/docs/content/docs/orm/reference/error-reference.mdx
8 changes: 4 additions & 4 deletions .github/workflows/sync-error-reference-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ jobs:
run: node ./scripts/generate-error-reference.mjs --source ../../prisma-src/docs/reference/error-reference.md

- name: Verify page lists every known error code
run: node prisma-src/scripts/list-error-codes.mjs --root prisma-src --verify apps/docs/content/docs/orm/v8/reference/error-reference.mdx
run: node prisma-src/scripts/list-error-codes.mjs --root prisma-src --verify apps/docs/content/docs/orm/reference/error-reference.mdx

- name: Check for changes
id: changes
run: |
if [[ -z "$(git status --porcelain --untracked-files=all -- apps/docs/content/docs/orm/v8/reference/error-reference.mdx)" ]]; then
if [[ -z "$(git status --porcelain --untracked-files=all -- apps/docs/content/docs/orm/reference/error-reference.mdx)" ]]; then
echo "changed=false" >> $GITHUB_OUTPUT
echo "No changes detected"
else
echo "changed=true" >> $GITHUB_OUTPUT
echo "Changes detected:"
git status --short -- apps/docs/content/docs/orm/v8/reference/error-reference.mdx
git status --short -- apps/docs/content/docs/orm/reference/error-reference.mdx
fi

- name: Commit and push
Expand All @@ -65,7 +65,7 @@ jobs:
run: |
git config user.email "prismabots@gmail.com"
git config user.name "Prismo"
git add apps/docs/content/docs/orm/v8/reference/error-reference.mdx
git add apps/docs/content/docs/orm/reference/error-reference.mdx
git commit -m "chore(docs): sync Prisma 8 error reference"
git push "https://x-access-token:${BOT_TOKEN}@github.com/${TARGET_REPO}.git" "HEAD:${TARGET_REF}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ You can find the [example repo](https://github.com/prisma/prisma-atlas) for this

## Why use Atlas instead of Prisma Migrate?

[Prisma Migrate](https://www.prisma.io/migrate) is a migration tool that covers the majority of use cases application developers have when managing their database schemas. It provides workflows specifically designed for taking you [from development to production](https://www.prisma.io/docs/orm/prisma-migrate/workflows/development-and-production) and with [team collaboration](https://www.prisma.io/docs/orm/prisma-migrate/workflows/team-development) in mind.
[Prisma Migrate](https://www.prisma.io/migrate) is a migration tool that covers the majority of use cases application developers have when managing their database schemas. It provides workflows specifically designed for taking you [from development to production](https://www.prisma.io/docs/orm/v7/prisma-migrate/workflows/development-and-production) and with [team collaboration](https://www.prisma.io/docs/orm/prisma-migrate/workflows/team-development) in mind.

However, for even more capabilities, you may use a dedicated tool like Atlas to extend your migration workflows in the following scenarios:

Expand All @@ -49,7 +49,7 @@ To complete this guide, you need:

For the purpose of this guide, we'll assume that your Prisma schema contains the standard `User` and `Post` models that we use as [main examples](https://www.prisma.io/docs/orm/overview/introduction/what-is-prisma) across our documentation. If you don't have a Prisma ORM project, you can use the [`orm/script`](https://github.com/prisma/prisma-examples/tree/latest/orm/script) example to follow this guide.

In Prisma ORM 7, the database connection URL lives in [`prisma.config.ts`](https://www.prisma.io/docs/orm/reference/prisma-config-reference), not in the `datasource` block of `schema.prisma`. A minimal config looks like this:
In Prisma ORM 7, the database connection URL lives in [`prisma.config.ts`](https://www.prisma.io/docs/orm/v7/reference/prisma-config-reference), not in the `datasource` block of `schema.prisma`. A minimal config looks like this:

```ts
// prisma.config.ts
Expand Down Expand Up @@ -120,7 +120,7 @@ In the above snippet, you're doing two things:

- Define an `external_schema` called `prisma` via the `data` block: Atlas integrates database schema definitions from various sources. In this case, the _source_ is the SQL that's generated by the `prisma migrate diff` command, specified via the `program` field. (In Prisma ORM 7, the flag is `--to-schema`; the older `--to-schema-datamodel` was removed.)
- Specify details about your environment (called `local`) using the `env` block:
- `dev`: Points to a [shadow database](https://www.prisma.io/docs/orm/prisma-migrate/understanding-prisma-migrate/shadow-database) (which is called _dev database_ in Atlas). Similar to Prisma Migrate, Atlas uses a shadow database to "dry-run" migrations. The connection you provide here is similar to the `shadowDatabaseUrl` in the Prisma schema. For convenience we're using Docker in this case to manage these ephemeral database instances.
- `dev`: Points to a [shadow database](https://www.prisma.io/docs/orm/v7/prisma-migrate/understanding-prisma-migrate/shadow-database) (which is called _dev database_ in Atlas). Similar to Prisma Migrate, Atlas uses a shadow database to "dry-run" migrations. The connection you provide here is similar to the `shadowDatabaseUrl` in the Prisma schema. For convenience we're using Docker in this case to manage these ephemeral database instances.
- `schema`: Points to the database connection URL of the database targeted by Prisma ORM (in most cases, this will be identical to the `DATABASE_URL` environment variable).
- `migration`: Points to the directory on your file system where you want to store the Atlas migration files (similar to the `prisma/migrations` folder). Note that you're also [excluding](https://atlasgo.io/versioned/diff) the `_prisma_migrations` table from being tracked in Atlas' migration history.

Expand Down Expand Up @@ -196,7 +196,7 @@ Next, you'll learn how to make edits to your Prisma schema and reflect the chang
4. Run `npx prisma generate` to update your Prisma Client
5. Access the modified schema in your application code via Prisma Client

For the purpose of this tutorial, we're going to expand the Prisma schema with a `Tag` model that has a [many-to-many relation](https://www.prisma.io/docs/orm/prisma-schema/data-model/relations/many-to-many-relations#implicit-many-to-many-relations) to the `Post` model:
For the purpose of this tutorial, we're going to expand the Prisma schema with a `Tag` model that has a [many-to-many relation](https://www.prisma.io/docs/orm/v7/prisma-schema/data-model/relations/many-to-many-relations#implicit-many-to-many-relations) to the `Post` model:

```diff
model User {
Expand Down Expand Up @@ -258,7 +258,7 @@ atlas migrate apply \
--env local \
--url __DATABASE_URL__
```
Your database schema is now updated, but your generated Prisma Client isn't aware of the schema change yet. In Prisma ORM 7, the recommended [`prisma-client` generator](https://www.prisma.io/docs/orm/prisma-schema/overview/generators) writes the Client to an explicit `output` path rather than into `node_modules`:
Your database schema is now updated, but your generated Prisma Client isn't aware of the schema change yet. In Prisma ORM 7, the recommended [`prisma-client` generator](https://www.prisma.io/docs/orm/v7/prisma-schema/overview/generators) writes the Client to an explicit `output` path rather than into `node_modules`:

```prisma
generator client {
Expand Down Expand Up @@ -394,4 +394,4 @@ In this tutorial, you learned how to integrate Atlas into an existing Prisma ORM

Check out the [example repo](https://github.com/prisma/prisma-atlas/) if you want to have a quick look at the final result of this tutorial.

Looking ahead: [Prisma 8](https://www.prisma.io/docs/orm) is a TypeScript-native rewrite of Prisma ORM, built for AI coding agents and now available as a Release Candidate. Until it reaches general availability, Prisma 7 stays the production choice. To try it, run `npm create prisma@latest` or read the [Prisma 8 docs](https://pris.ly/pn-ea).
Looking ahead: [Prisma 8](https://www.prisma.io/docs/orm) is a TypeScript-native rewrite of Prisma ORM, built for AI coding agents, and it is now the current release. Prisma 7 remains fully supported; its docs live at [prisma.io/docs/orm/v7](https://www.prisma.io/docs/orm/v7). To start with Prisma 8, run `npm create prisma@latest` or read the [Prisma 8 docs](https://www.prisma.io/docs/getting-started).
2 changes: 1 addition & 1 deletion apps/blog/content/blog/agents-md-for-databases/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Be clear about what the rehearsal proves: the migration applies cleanly to real

### Prefer machine-readable output

Terminal output with spinners and box-drawing characters is written for humans. An agent can read it, but it spends tokens on decoration and invites misextraction; a named JSON field is unambiguous. Where a CLI offers structured output, the agent should use it: `create-db` has `--json`, the Prisma CLI supports it on commands like `prisma version --json`, and the [Prisma 8](https://www.prisma.io/docs/cli/v8) CLI (the next-generation Prisma ORM, currently a Release Candidate) carries `--json` across its command surface, from `db schema` to `migration show`. The rule generalizes beyond Prisma: prefer a `--json` flag anywhere one exists, and parse fields instead of scraping text.
Terminal output with spinners and box-drawing characters is written for humans. An agent can read it, but it spends tokens on decoration and invites misextraction; a named JSON field is unambiguous. Where a CLI offers structured output, the agent should use it: `create-db` has `--json`, the Prisma CLI supports it on commands like `prisma version --json`, and the [Prisma 8](https://www.prisma.io/docs/cli) CLI (the next-generation Prisma ORM, currently a Release Candidate) carries `--json` across its command surface, from `db schema` to `migration show`. The rule generalizes beyond Prisma: prefer a `--json` flag anywhere one exists, and parse fields instead of scraping text.

### Connection strings live in the environment

Expand Down
2 changes: 1 addition & 1 deletion apps/blog/content/blog/announcing-prisma-6-18-0/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default defineConfig({
}
});
```
For a full reference of the options that can be used in Prisma Config, see the [docs](https://www.prisma.io/docs/orm/reference/prisma-config-reference).
For a full reference of the options that can be used in Prisma Config, see the [docs](https://www.prisma.io/docs/orm/v7/reference/prisma-config-reference).

Be sure to follow us on social media to stay up to date with all the latest release of Prisma ORM and Prisma Postgres

Expand Down
2 changes: 1 addition & 1 deletion apps/blog/content/blog/announcing-prisma-6-19-0/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ With this release, we’re very close to the next major release of Prisma, v7. T
});
```

For a full reference of the options that can be used in Prisma Config, see the [docs](https://www.prisma.io/docs/orm/reference/prisma-config-reference).
For a full reference of the options that can be used in Prisma Config, see the [docs](https://www.prisma.io/docs/orm/v7/reference/prisma-config-reference).

If you want to go deeper on the Postgres side of this release, explore [Prisma Postgres](https://www.prisma.io/postgres), review [pricing](https://www.prisma.io/pricing), and check the [connection pooling docs](https://www.prisma.io/docs/postgres/database/connection-pooling).

Expand Down
10 changes: 5 additions & 5 deletions apps/blog/content/blog/announcing-prisma-orm-7-2-0/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ To upgrade to the latest release, install the appropriate packages using the `@l

```shell
# The Prisma CLI
npm install prisma@latest --save-dev
npm install prisma@7.9.1 --save-dev

# The Prisma Client Library
npm install @prisma/client@latest
npm install @prisma/client@7.9.1

# The adapter for your database
npm install @prisma/adapter-pg@latest
Expand All @@ -46,7 +46,7 @@ As part of the move to a Prisma config file, running `prisma init` would generat

```tsx
// This file was generated by Prisma and assumes you have installed the following:
// npm install --save-dev prisma dotenv
// npm install --save-dev prisma@7.9.1 dotenv
import "dotenv/config";
import { defineConfig, env } from "prisma/config";

Expand Down Expand Up @@ -82,7 +82,7 @@ For Node environments (`npx`, `pnpm`, `bunx`, `bun run`):

```tsx
// This file was generated by Prisma and assumes you have installed the following:
// npm install --save-dev prisma dotenv
// npm install --save-dev prisma@7.9.1 dotenv
import "dotenv/config";
import { defineConfig } from "prisma/config";

Expand Down Expand Up @@ -122,7 +122,7 @@ This issue was reported back in July, and we’re thrilled that it’s been fixe

- [Explore Prisma ORM](https://www.prisma.io/orm) for the latest Prisma 7 releases and capabilities.
- [Review the Prisma 7 upgrade guide](https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-7) before rolling 7.2.0 out more broadly.
- [Refresh your Prisma Client generation setup](https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/generating-prisma-client) if you're adopting the newer Prisma config workflow.
- [Refresh your Prisma Client generation setup](https://www.prisma.io/docs/orm/v7/prisma-client/setup-and-configuration/generating-prisma-client) if you're adopting the newer Prisma config workflow.

## Parting Thoughts

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ It offers the reliability developers need without the operational complexity tha

To try out Prisma Postgres, simply run this command in your terminal:
```
npx prisma init --db
npx prisma@7.9.1 init --db
```
Prisma Postgres also integrates directly with your favorite LLM and AI coding environment via the Model Context Protocol (MCP).

Expand Down
Loading
Loading