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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/200-orm/300-prisma-migrate/050-getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ To create a baseline migration:
```terminal no-lines
npx prisma migrate diff \
--from-empty \
--to-schema-datamodel prisma/schema.prisma \
--to-schema prisma/schema.prisma \
--script > prisma/migrations/0_init/migration.sql
```
1. Review the generated migration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ To create a baseline migration:
```terminal no-lines
npx prisma migrate diff \
--from-empty \
--to-schema-datamodel prisma/schema.prisma \
--to-schema prisma/schema.prisma \
--script > prisma/migrations/0_init/migration.sql
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Then follow these steps, either on your `main` branch or on a newly checked out
```terminal
npx prisma migrate diff \
--from-empty \
--to-schema-datamodel ./prisma/schema.prisma \
--to-schema ./prisma/schema.prisma \
--script > ./prisma/migrations/000000000000_squashed_migrations/migration.sql
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ You will need to create the down migration first, before creating the correspond

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

```terminal wrap
npx prisma migrate diff \
--from-schema-datamodel prisma/schema.prisma \
--from-schema prisma/schema.prisma \
--to-schema-datasource prisma/schema.prisma \
--script > down.sql
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ In this case, you need to fix the non-unique data and then go ahead with the res

```bash

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

```

Expand Down
4 changes: 2 additions & 2 deletions content/200-orm/500-reference/200-prisma-cli-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,7 @@ One of the following `--from-...` options is required:
| :------------------------- | :------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------- |
| `--from-url` | A data source URL | |
| `--from-migrations` | Path to the Prisma Migrate migrations directory | Not supported in MongoDB |
| `--from-schema-datamodel` | Path to a Prisma schema file, uses the data model for the diff | |
| `--from-schema` | Path to a Prisma schema file, uses the data model for the diff | |
| `--from-schema-datasource` | Path to a Prisma schema file, uses the URL in the `datasource` block for the diff | |
| `--from-empty` | Assume that you the data model you are migrating from is empty | |
| `--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) |
Expand All @@ -1632,7 +1632,7 @@ One of the following `--to-...` options is required:
| :----------------------- | :------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------- |
| `--to-url` | A data source URL | |
| `--to-migrations` | Path to the Prisma Migrate migrations directory | Not supported in MongoDB |
| `--to-schema-datamodel` | Path to a Prisma schema file, uses the data model for the diff | |
| `--to-schema` | Path to a Prisma schema file, uses the data model for the diff | |
| `--to-schema-datasource` | Path to a Prisma schema file, uses the URL in the `datasource` block for the diff | |
| `--to-empty` | Assume that you the data model you are migrating to is empty | |
| `--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) |
Expand Down
2 changes: 1 addition & 1 deletion content/800-guides/030-migrate-from-typeorm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ This will create a `schema.prisma` file with your database schema.
Create and apply a baseline migration to mark the current state of your database:

```terminal
npx prisma migrate diff --from-empty --to-schema-datamodel prisma/schema.prisma --script > baseline.sql
npx prisma migrate diff --from-empty --to-schema prisma/schema.prisma --script > baseline.sql
npx prisma migrate resolve --applied "baseline"
```

Expand Down
4 changes: 2 additions & 2 deletions content/800-guides/040-migrate-from-sequelize.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ mkdir -p prisma/migrations/0_init
Next, generate the migration file with `prisma migrate diff`. Use the following arguments:

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

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

Expand Down
4 changes: 2 additions & 2 deletions content/800-guides/060-migrate-from-drizzle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,11 @@ mkdir -p prisma/migrations/0_init
Next, generate the migration file with `prisma migrate diff`. Use the following arguments:

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

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

Review the generated migration to ensure everything is correct.
Expand Down
2 changes: 1 addition & 1 deletion content/800-guides/070-cloudflare-d1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ For future schema changes, you can generate new migration files using:
```terminal
npx prisma migrate diff \
--from-local-d1 \
--to-schema-datamodel prisma/schema.prisma \
--to-schema prisma/schema.prisma \
--script > migrations/0002_add_new_field.sql
```

Expand Down
Loading