Skip to content

Commit 66f81e3

Browse files
ArthurGambyArthur Gamby
andauthored
fix: update deprecated prisma migrate diff flags (#7348)
Co-authored-by: Arthur Gamby <arthurgamby@Mac-002.lan>
1 parent 2076e5a commit 66f81e3

File tree

10 files changed

+14
-14
lines changed

10 files changed

+14
-14
lines changed

content/200-orm/300-prisma-migrate/050-getting-started.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ To create a baseline migration:
231231
```terminal no-lines
232232
npx prisma migrate diff \
233233
--from-empty \
234-
--to-schema-datamodel prisma/schema.prisma \
234+
--to-schema prisma/schema.prisma \
235235
--script > prisma/migrations/0_init/migration.sql
236236
```
237237
1. Review the generated migration.

content/200-orm/300-prisma-migrate/300-workflows/30-baselining.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ To create a baseline migration:
7272
```terminal no-lines
7373
npx prisma migrate diff \
7474
--from-empty \
75-
--to-schema-datamodel prisma/schema.prisma \
75+
--to-schema prisma/schema.prisma \
7676
--script > prisma/migrations/0_init/migration.sql
7777
```
7878

content/200-orm/300-prisma-migrate/300-workflows/50-squashing-migrations.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Then follow these steps, either on your `main` branch or on a newly checked out
112112
```terminal
113113
npx prisma migrate diff \
114114
--from-empty \
115-
--to-schema-datamodel ./prisma/schema.prisma \
115+
--to-schema ./prisma/schema.prisma \
116116
--script > ./prisma/migrations/000000000000_squashed_migrations/migration.sql
117117
```
118118

content/200-orm/300-prisma-migrate/300-workflows/60-generating-down-migrations.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ You will need to create the down migration first, before creating the correspond
109109

110110
```terminal wrap
111111
npx prisma migrate diff \
112-
--from-schema-datamodel prisma/schema.prisma \
112+
--from-schema prisma/schema.prisma \
113113
--to-migrations prisma/migrations \
114114
--shadow-database-url $SHADOW_DATABASE_URL \
115115
--script > down.sql
@@ -119,7 +119,7 @@ You will need to create the down migration first, before creating the correspond
119119

120120
```terminal wrap
121121
npx prisma migrate diff \
122-
--from-schema-datamodel prisma/schema.prisma \
122+
--from-schema prisma/schema.prisma \
123123
--to-schema-datasource prisma/schema.prisma \
124124
--script > down.sql
125125
```

content/200-orm/300-prisma-migrate/300-workflows/70-patching-and-hotfixing.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ In this case, you need to fix the non-unique data and then go ahead with the res
226226

227227
```bash
228228

229-
npx prisma migrate diff --from-url "$DATABASE_URL_PROD" --to-schema-datamodel schema.prisma --script > forward.sql
229+
npx prisma migrate diff --from-url "$DATABASE_URL_PROD" --to-schema schema.prisma --script > forward.sql
230230

231231
```
232232

content/200-orm/500-reference/200-prisma-cli-reference.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,7 +1621,7 @@ One of the following `--from-...` options is required:
16211621
| :------------------------- | :------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------- |
16221622
| `--from-url` | A data source URL | |
16231623
| `--from-migrations` | Path to the Prisma Migrate migrations directory | Not supported in MongoDB |
1624-
| `--from-schema-datamodel` | Path to a Prisma schema file, uses the data model for the diff | |
1624+
| `--from-schema` | Path to a Prisma schema file, uses the data model for the diff | |
16251625
| `--from-schema-datasource` | Path to a Prisma schema file, uses the URL in the `datasource` block for the diff | |
16261626
| `--from-empty` | Assume that you the data model you are migrating from is empty | |
16271627
| `--from-local-d1` | Path to a local D1 instance ([learn more](/orm/overview/databases/cloudflare-d1#using-the-wrangler-cli-with-prisma-migrate-diff)) | Available since [5.12.0](https://github.com/prisma/prisma/releases/tag/5.12.0) |
@@ -1632,7 +1632,7 @@ One of the following `--to-...` options is required:
16321632
| :----------------------- | :------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------- |
16331633
| `--to-url` | A data source URL | |
16341634
| `--to-migrations` | Path to the Prisma Migrate migrations directory | Not supported in MongoDB |
1635-
| `--to-schema-datamodel` | Path to a Prisma schema file, uses the data model for the diff | |
1635+
| `--to-schema` | Path to a Prisma schema file, uses the data model for the diff | |
16361636
| `--to-schema-datasource` | Path to a Prisma schema file, uses the URL in the `datasource` block for the diff | |
16371637
| `--to-empty` | Assume that you the data model you are migrating to is empty | |
16381638
| `--to-local-d1` | Path to a local D1 instance ([learn more](/orm/overview/databases/cloudflare-d1#using-the-wrangler-cli-with-prisma-migrate-diff)) | Available since [5.12.0](https://github.com/prisma/prisma/releases/tag/5.12.0) |

content/800-guides/030-migrate-from-typeorm.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ This will create a `schema.prisma` file with your database schema.
9797
Create and apply a baseline migration to mark the current state of your database:
9898

9999
```terminal
100-
npx prisma migrate diff --from-empty --to-schema-datamodel prisma/schema.prisma --script > baseline.sql
100+
npx prisma migrate diff --from-empty --to-schema prisma/schema.prisma --script > baseline.sql
101101
npx prisma migrate resolve --applied "baseline"
102102
```
103103

content/800-guides/040-migrate-from-sequelize.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ mkdir -p prisma/migrations/0_init
132132
Next, generate the migration file with `prisma migrate diff`. Use the following arguments:
133133

134134
- `--from-empty`: assumes the data model you're migrating from is empty
135-
- `--to-schema-datamodel`: the current database state using the URL in the `datasource` block
135+
- `--to-schema`: the current database state using the URL in the `datasource` block
136136
- `--script`: output a SQL script
137137

138138
```terminal wrap
139-
npx prisma migrate diff --from-empty --to-schema-datamodel prisma/schema.prisma --script > prisma/migrations/0_init/migration.sql
139+
npx prisma migrate diff --from-empty --to-schema prisma/schema.prisma --script > prisma/migrations/0_init/migration.sql
140140
npx prisma migrate resolve --applied 0_init
141141
```
142142

content/800-guides/060-migrate-from-drizzle.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,11 @@ mkdir -p prisma/migrations/0_init
215215
Next, generate the migration file with `prisma migrate diff`. Use the following arguments:
216216

217217
- `--from-empty`: assumes the data model you're migrating from is empty
218-
- `--to-schema-datamodel`: the current database state using the URL in the `datasource` block
218+
- `--to-schema`: the current database state using the URL in the `datasource` block
219219
- `--script`: output a SQL script
220220

221221
```terminal wrap
222-
npx prisma migrate diff --from-empty --to-schema-datamodel prisma/schema.prisma --script > prisma/migrations/0_init/migration.sql
222+
npx prisma migrate diff --from-empty --to-schema prisma/schema.prisma --script > prisma/migrations/0_init/migration.sql
223223
```
224224

225225
Review the generated migration to ensure everything is correct.

content/800-guides/070-cloudflare-d1.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ For future schema changes, you can generate new migration files using:
227227
```terminal
228228
npx prisma migrate diff \
229229
--from-local-d1 \
230-
--to-schema-datamodel prisma/schema.prisma \
230+
--to-schema prisma/schema.prisma \
231231
--script > migrations/0002_add_new_field.sql
232232
```
233233

0 commit comments

Comments
 (0)