Skip to content

Commit c20da97

Browse files
docs(docs): update the Prisma ORM 8 pages for 8.0.0-rc.25 (#8896)
* docs(docs): update the Prisma ORM 8 pages for 8.0.0-rc.25 Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(docs): db migrate advances the db ref by default since 8.0.0-rc.25 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(docs): db migrate moves the db ref without --advance-ref db, across the Prisma ORM 8 pages Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(docs): correct the db ref guidance after review Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(docs): bring the Prisma ORM 8.0.0-rc.25 CLI pages in line with the docs writing guidance Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(docs): bring the Prisma ORM 8.0.0-rc.25 ORM and guide pages in line with the docs writing guidance Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(docs): correct nine statements in the Prisma ORM 8.0.0-rc.25 pages and settle the open points Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(docs): connect on many-to-many fails on MariaDB too, and fns.raw takes the stored type Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(cli): run the commands the error prints, now that 8.0.0-rc.25 prints working ones Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(docs): answer the review of the Prisma ORM 8.0.0-rc.25 pages Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(docs): the printed apply command has no --db unless you passed it, and three smaller corrections Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(cli): --backfill also takes a field inside a document on MongoDB Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(docs): printed commands carry --db only when you passed it, and db init does not read the change policy Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(orm): the policies page names the commands that read the change policy, and says nothing of db init yet Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(docs): answer the second review of the Prisma ORM 8.0.0-rc.25 pages Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(docs): name prisma 8.0.0-rc.35 and the engine version it installs Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(docs): mark the orm init note about 8.0.0-rc.34 as history Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(docs): say which money rows are affected, and name MariaDB for nested writes Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(docs): state the MySQL and MariaDB limits on nested connect, and name the package for each version Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> --------- Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
1 parent 0157c99 commit c20da97

80 files changed

Lines changed: 908 additions & 410 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/docs/content/docs/(index)/getting-started.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Check the Node.js version first: `node --version` must print 22.18 or newer on t
4646
1. Scaffold the app: `npm create prisma@latest -- my-app --template [framework] --provider postgres --yes`.
4747
2. Get a database connection string: use the one I give you, or create a Prisma Postgres database with `npx create-db@latest` and show me the claim URL it prints. Export it as `DATABASE_URL` in the shell: in a project created with `npm create prisma`, the Prisma CLI scripts in package.json read the environment variable, not `.env`.
4848
3. From the project directory, apply the starter contract: `npm run db:init`. The app seeds sample users on its first query, from `src/prisma/seed.ts` (`packages/database/src/seed.ts` for turborepo); there is no seed command to run.
49-
4. Edit the starter contract under `src/prisma/` (`packages/database/src/` for turborepo) into a small schema for my use case, then run `npm run contract:emit` and plan and apply the migration: `npx prisma migration plan --name <name>`, then `npx prisma db migrate --advance-ref db --yes`. Migration planning diffs the emitted contract, so the emit step is required. Pass `--advance-ref db` on every apply to this development database, so that the next `migration plan` starts from the state you applied; without it, the next plan repeats the last change and `db migrate` fails with `MIGRATION.PATH_UNREACHABLE`.
49+
4. Edit the starter contract under `src/prisma/` (`packages/database/src/` for turborepo) into a small schema for my use case, then run `npm run contract:emit` and plan and apply the migration: `npx prisma migration plan --name <name>`, then `npx prisma db migrate --yes`. Migration planning diffs the emitted contract, so the emit step is required. `db migrate` also points the `db` ref at the state you applied, so that the next `migration plan` starts from there. If it prints `MIGRATION.REF_NOT_ADVANCED_IN_CI`, the CLI found a CI variable such as `CI` in your environment and left the ref unchanged: run the command that the notice prints for a development machine, which adds `--advance-ref db`, before you plan again.
5050
5. Update `src/prisma/seed.ts` (`packages/database/src/seed.ts` for turborepo) and the app routes to query the new schema, start `npm run dev` in the background (with `DATABASE_URL` exported), and verify with a request against the running app. For the `nest` template, if routes return 500s with `reading 'findAll'` in the logs, add explicit `@Inject()` tokens as shown in https://www.prisma.io/docs/guides/frameworks/nestjs.md.
5151
5252
Use the installed Prisma ORM skills and the current Prisma docs: https://www.prisma.io/docs/llms.txt (append `.md` to any docs URL for a markdown version).

‎apps/docs/content/docs/(index)/index.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Check the Node.js version first: `node --version` must print 22.18 or newer on t
126126
127127
1. Scaffold: `npm create prisma@latest -- my-app --template [framework] --provider postgres --yes`.
128128
2. Export my connection string as `DATABASE_URL` in the shell; the generated scripts read the environment variable, not `.env`. From the project directory: `npm run db:init`, then start `npm run dev` in the background and verify the sample query returns data. The app seeds sample users on its first query, from `src/prisma/seed.ts` (`packages/database/src/seed.ts` for turborepo); there is no seed command to run.
129-
3. Evolve the starter contract under `src/prisma/` (`packages/database/src/` for turborepo) into my schema, then run `npm run contract:emit`, `npx prisma migration plan --name <name>`, and `npx prisma db migrate --advance-ref db --yes`. Pass `--advance-ref db` on every apply to this development database, so that the next `migration plan` starts from the state you applied; without it, the next plan repeats the last change and `db migrate` fails with `MIGRATION.PATH_UNREACHABLE`.
129+
3. Evolve the starter contract under `src/prisma/` (`packages/database/src/` for turborepo) into my schema, then run `npm run contract:emit`, `npx prisma migration plan --name <name>`, and `npx prisma db migrate --yes`. `db migrate` also points the `db` ref at the state you applied, so that the next `migration plan` starts from there.
130130
131131
Do not provision any hosted database. Use the installed Prisma ORM skills and https://www.prisma.io/docs/llms.txt for current docs.
132132
```

‎apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/mongodb.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,11 @@ Before it adds a validator, `db update` checks the documents already in the coll
240240

241241
When it succeeds, `db update` records which contract the database matches, in the database and in the file `migrations/app/refs/db.json`, called the `db` ref. `migration plan` starts from that record. Without it, `migration plan` plans every collection from an empty database, and `db migrate` then stops with `MIGRATION.PRECHECK_FAILED` because the collection already exists. If that happened to you, delete the directory that `migration plan` wrote under `migrations/app/`, run `npx prisma db update --advance-ref db`, and plan again. That plan writes only a baseline, because `db update` has already applied your change.
242242

243-
After that, every change follows four steps: edit `src/prisma/contract.prisma`, run `npx prisma contract emit`, run `npx prisma migration plan --name <name>`, and run `npx prisma db migrate --advance-ref db`. Commit the `migrations/` directory. Your first `migration plan` writes two directories under `migrations/app/`: a baseline, whose name ends in `_baseline` and which describes the collections as `db update` left them, and your change.
243+
After that, every change follows four steps: edit `src/prisma/contract.prisma`, run `npx prisma contract emit`, run `npx prisma migration plan --name <name>`, and run `npx prisma db migrate`. Commit the `migrations/` directory. Your first `migration plan` writes two directories under `migrations/app/`: a baseline, whose name ends in `_baseline` and which describes the collections as `db update` left them, and your change.
244244

245245
### Production and other databases
246246

247-
Any other database whose collections already exist, such as production, needs the same first step before `db migrate` can run there. Leave out `--advance-ref` for those databases, because the `db` ref tracks your development database.
247+
Any other database whose collections already exist, such as production, needs the same first step before `db migrate` can run there. Pass that database's connection string with `--db`: `db migrate` then leaves the `db` ref alone, because the ref tracks your development database.
248248

249249
If you have not planned a migration yet, run:
250250

‎apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/postgresql.mdx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ You can ignore the word `space` in the output, because all your migrations are i
389389
Apply the migration:
390390

391391
```npm
392-
npx prisma db migrate --advance-ref db
392+
npx prisma db migrate
393393
```
394394

395395
```text no-copy
@@ -406,9 +406,9 @@ App space
406406
✔ Advanced ref "db" → 7d5976dd0655cf4b1603d0126720d50248ab95881db001c8e924291efc61f336
407407
```
408408

409-
`db migrate` runs only the migrations that the database does not have yet. Here it adds the `phone` column, and the rows in your tables stay as they are. `marker` in the output is the record from `db sign`, which now holds the new hash. Pass `--advance-ref db` every time you apply a migration to your development database, so that the next `migration plan` contains only your next change.
409+
`db migrate` runs only the migrations that the database does not have yet. Here it adds the `phone` column, and the rows in your tables stay as they are. `marker` in the output is the record from `db sign`, which now holds the new hash. `db migrate` also points the `db` ref at the new hash, so that the next `migration plan` contains only your next change.
410410

411-
To apply the migration to another database with the same tables, such as production, pass its connection string. Leave out `--advance-ref` there, because the `db` ref tracks your development database:
411+
To apply the migration to another database with the same tables, such as production, pass its connection string. With `--db`, `db migrate` leaves the `db` ref alone, because the ref tracks your development database:
412412

413413
```npm
414414
npx prisma db migrate --db "$PRODUCTION_DATABASE_URL"
@@ -418,7 +418,7 @@ You do not need to run `db sign` on that database. `db migrate` finds that the t
418418

419419
## Next steps
420420

421-
Every later change follows the same four steps: edit `src/prisma/contract.prisma`, run `npx prisma contract emit`, run `npx prisma migration plan --name <name>`, and run `npx prisma db migrate --advance-ref db`.
421+
Every later change follows the same four steps: edit `src/prisma/contract.prisma`, run `npx prisma contract emit`, run `npx prisma migration plan --name <name>`, and run `npx prisma db migrate`.
422422

423423
- [Generating a migration](/orm/migrations/generating-a-migration) for what a migration directory contains and how to edit it.
424424
- [`db update`](/cli/db-update) to apply a contract change to a development database without writing migration files.

‎apps/docs/content/docs/(index)/prisma-orm/create-prisma.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ npm run db:init
107107
npm run dev
108108
```
109109

110-
Sample records are seeded on the app's first query. From there, change the contract under `src/prisma/` (`packages/database/src/` in the `turborepo` template), run `npm run contract:emit`, plan the migration with `npm run migration:plan -- --name <name>`, and apply it with `npm run migrate -- --advance-ref db`. Keep `--advance-ref db` on every apply in development: it points the `db` ref at the state you applied, and the next `migration plan` starts from there. Without it, the next plan starts from the state before your last migration and plans its changes again, and `npm run migrate` then fails with `MIGRATION.PATH_UNREACHABLE`. [Create a new app with PostgreSQL](/prisma-orm/quickstart/postgresql) covers that loop in detail, and [Create a new app with MongoDB](/prisma-orm/quickstart/mongodb) covers the MongoDB connection string.
110+
Sample records are seeded on the app's first query. From there, change the contract under `src/prisma/` (`packages/database/src/` in the `turborepo` template), run `npm run contract:emit`, plan the migration with `npm run migration:plan -- --name <name>`, and apply it with `npm run migrate`. Each apply points the `db` ref at the state you applied, and the next `migration plan` starts from there. [Create a new app with PostgreSQL](/prisma-orm/quickstart/postgresql) covers that loop in detail, and [Create a new app with MongoDB](/prisma-orm/quickstart/mongodb) covers the MongoDB connection string.
111111

112112
### Generated scripts
113113

‎apps/docs/content/docs/(index)/prisma-orm/from-scratch.mdx‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ npm pkg set type=module
3939
Install the runtime library, the command-line tool, and the tooling to run a TypeScript file:
4040

4141
```npm
42-
npm install @prisma/orm-postgres dotenv
43-
npm install --save-dev prisma tsx typescript
42+
npm install @prisma/orm-postgres pg dotenv
43+
npm install --save-dev prisma tsx typescript @types/pg
4444
```
4545

46-
`@prisma/orm-postgres` is the library your code imports, and `prisma` is the command-line tool. `dotenv` loads `.env`, `tsx` runs `index.ts` without a build step, and `typescript` 5.9 or newer is a peer dependency of `@prisma/orm-postgres`.
46+
`@prisma/orm-postgres` is the library your code imports, and `prisma` is the command-line tool. `pg` is the PostgreSQL driver, a peer dependency of `@prisma/orm-postgres`, and `@types/pg` gives TypeScript its types. `dotenv` loads `.env`, `tsx` runs `index.ts` without a build step, and `typescript` 5.9 or newer is a peer dependency of `@prisma/orm-postgres`.
4747

4848
`temporal-polyfill` is a peer dependency of `@prisma/orm-postgres` too. It adds `Temporal`, the newer JavaScript date and time API, to runtimes such as Node.js 24 that do not have it built in. npm installs it for you, but with Yarn you add it yourself.
4949

50-
The two Prisma packages have different version numbers, for example `prisma` 8.0.0-rc.34 and `@prisma/orm-postgres` 8.0.0-rc.24. That is normal, and any two `latest` versions work together.
50+
The two Prisma packages have different version numbers, for example `prisma` 8.0.0-rc.35 and `@prisma/orm-postgres` 8.0.0-rc.25. That is normal, and any two `latest` versions work together.
5151

5252
## 2. Create the config file and `.env`
5353

@@ -253,10 +253,10 @@ ALTER TABLE "public"."User" ADD COLUMN "phone" text;
253253

254254
Two directories appear under `migrations/app/`: a baseline that records the table `db init` created, and your change. The baseline is never applied to this database, because the database is already signed at that state. Each migration directory holds a `migration.ts` you can read and edit; [Generating a migration](/orm/migrations/generating-a-migration) explains the files.
255255

256-
Apply the migration with `--advance-ref db`, which records that your development database is now at the new contract so the next `migration plan` starts from there:
256+
Apply the migration with `db migrate`, which also records in the `db` ref that your development database is now at the new contract, so the next `migration plan` starts from there:
257257

258258
```npm
259-
npx prisma db migrate --advance-ref db
259+
npx prisma db migrate
260260
```
261261

262262
```text
@@ -300,7 +300,7 @@ npx prisma migration status
300300
✔ Up to date
301301
```
302302

303-
From here, every schema change follows the same routine: edit `prisma/contract.prisma`, run `npx prisma contract emit`, run `npx prisma migration plan --name <name>`, and apply with `npx prisma db migrate --advance-ref db`.
303+
From here, every schema change follows the same routine: edit `prisma/contract.prisma`, run `npx prisma contract emit`, run `npx prisma migration plan --name <name>`, and apply with `npx prisma db migrate`.
304304

305305
## Next steps
306306

‎apps/docs/content/docs/(index)/prisma-orm/index.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Check the Node.js version first: `node --version` must print 22.18 or newer on t
108108
1. Scaffold the app: `npm create prisma@latest -- my-app --template [framework] --provider postgres --yes`. Then run `npx prisma@latest init` in the project directory so the Prisma agent skills are installed and stay current, and use them.
109109
2. Get a database connection string: use the one I give you, or create a Prisma Postgres database: check `npx prisma auth whoami` (if I am not signed in, stop and ask me to run `npx prisma auth login`), then `npx prisma project create my-app-db` and `npx prisma postgres create mydb`, which prints the connection string once. Name that project differently from the app, so that it does not collide with the project the deploy in step 6 creates. Export the connection string as `DATABASE_URL` in the shell: in a project created with `npm create prisma`, the Prisma CLI scripts in package.json read the environment variable, not `.env`.
110110
3. From the project directory, apply the starter contract: `npm run db:init`. The app seeds sample users on its first query, from `src/prisma/seed.ts` (`packages/database/src/seed.ts` for turborepo); there is no seed command to run.
111-
4. Edit the starter contract under `src/prisma/` (`packages/database/src/` for turborepo) into a small schema for my use case, then run `npm run contract:emit` and plan and apply the migration: `npx prisma migration plan --name <name>`, then `npx prisma db migrate --advance-ref db --yes`. Migration planning diffs the emitted contract, so the emit step is required. Pass `--advance-ref db` on every apply to this development database, so that the next `migration plan` starts from the state you applied; without it, the next plan repeats the last change and `db migrate` fails with `MIGRATION.PATH_UNREACHABLE`.
111+
4. Edit the starter contract under `src/prisma/` (`packages/database/src/` for turborepo) into a small schema for my use case, then run `npm run contract:emit` and plan and apply the migration: `npx prisma migration plan --name <name>`, then `npx prisma db migrate --yes`. Migration planning diffs the emitted contract, so the emit step is required. `db migrate` also points the `db` ref at the state you applied, so that the next `migration plan` starts from there.
112112
5. Update `src/prisma/seed.ts` (`packages/database/src/seed.ts` for turborepo) and the app routes to query the new schema, start `npm run dev` in the background (with `DATABASE_URL` exported), and verify with a request against the running app. For the `nest` template, if routes return 500s with `reading 'findAll'` in the logs, add explicit `@Inject()` tokens as shown in https://www.prisma.io/docs/guides/frameworks/nestjs.md.
113113
6. Deploy with Prisma Compute. The scaffold declares the app for Prisma Composer in `module.ts` and `service.ts`, with the framework's build requirements (Next.js standalone output, Astro's node adapter, SvelteKit's node adapter, TanStack Start's Nitro build) already configured; the framework guide at https://www.prisma.io/docs/guides/frameworks/[guide].md has the details, where [guide] is the template name except: template `next` → guide `nextjs`, `nest` → `nestjs`, `svelte` → `sveltekit`; `minimal` and `turborepo` have no framework guide. Check `npx prisma auth whoami`. If I am not signed in, stop and ask me to run `npx prisma auth login`, because that step opens a browser. Then run `npm run build` followed by `npx prisma deploy`, and verify the deployed URL with curl. The deployed app provisions and seeds its own Prisma Postgres database; do not pass the local DATABASE_URL. If the deploy fails with `HostedStateBootstrapError`, a project with the module's name exists in my workspace but its hosted state cannot be verified; re-run the deploy with `--name <a unique name>`.
114114

‎apps/docs/content/docs/(index)/prisma-orm/quickstart/existing-app/mongodb.mdx‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ installed
6161
├─ mongodb
6262
├─ prisma@latest (dev)
6363
├─ @types/node (dev)
64-
└─ @prisma/cli-engine@0.10.0 (dev)
64+
└─ @prisma/cli-engine@0.10.4 (dev)
6565
6666
✔ Done. Open prisma-8.md to get started.
6767
```
@@ -278,7 +278,7 @@ The output continues with a preview of the MongoDB commands. The first plan in a
278278
Apply the migration:
279279

280280
```npm
281-
npx prisma db migrate --advance-ref db
281+
npx prisma db migrate
282282
```
283283

284284
```text no-copy
@@ -295,17 +295,17 @@ App space
295295
✔ Advanced ref "db" → a7d00abb0f8fc9c9f5ace78b306278673e60cc5774ec1833cd0cfd334beead54
296296
```
297297

298-
`db migrate` runs only the migrations that the database does not have yet, so here it runs only your change. `--advance-ref db` writes the new hash to the `db` ref, so that the next `migration plan` contains only your next change. Pass it every time you apply a migration to your development database. Commit the `migrations/` directory again.
298+
`db migrate` runs only the migrations that the database does not have yet, so here it runs only your change. It also writes the new hash to the `db` ref, so that the next `migration plan` contains only your next change. Commit the `migrations/` directory again.
299299

300-
To apply the migrations to any other database, such as production, pass its connection string. Leave out `--advance-ref`, because the `db` ref describes your development database:
300+
To apply the migrations to any other database, such as production, pass its connection string. With `--db`, `db migrate` leaves the `db` ref alone, because the ref describes your development database:
301301

302302
```npm
303303
npx prisma db migrate --db "$PRODUCTION_DATABASE_URL"
304304
```
305305

306306
`db migrate` runs the migrations that this database does not have yet. An empty database has no marker, so there `db migrate` runs the baseline and then your change.
307307

308-
Every later change follows the same four steps, which take the place of `prisma migrate dev`: edit `src/prisma/contract.prisma`, run `npx prisma contract emit`, run `npx prisma migration plan --name <name>`, and run `npx prisma db migrate --advance-ref db`.
308+
Every later change follows the same four steps, which take the place of `prisma migrate dev`: edit `src/prisma/contract.prisma`, run `npx prisma contract emit`, run `npx prisma migration plan --name <name>`, and run `npx prisma db migrate`.
309309

310310
## Next steps
311311

0 commit comments

Comments
 (0)