Skip to content

Commit d521389

Browse files
Update what is Prisma page for Migrate (prisma#1212)
1 parent 45c9d69 commit d521389

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

content/200-concepts/050-overview/100-what-is-prisma/index.mdx

+17-14
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ The data model is a collection of [models](../../components/prisma-schema/data-m
8080

8181
There are two major workflows for "getting" a data model into your Prisma schema:
8282

83-
- Generating the data model from [introspecting](../../components/introspection) a database
8483
- Manually writing the data model and mapping it to the database with [Prisma Migrate](../../components/prisma-migrate)
84+
- Generating the data model by [introspecting](../../components/introspection) a database
8585

8686
Once the data model is defined, you can [generate Prisma Client](../../components/prisma-client/generating-prisma-client) which will expose CRUD and more queries for the defined models. If you're using TypeScript, you'll get full type-safety for all queries (even when only retrieving the subsets of a model's fields).
8787

@@ -194,27 +194,30 @@ Note that when using TypeScript, the result of this query will be _statically ty
194194

195195
As mentioned above, there are two ways for "getting" your data model into the Prisma schema. Depending on which approach you choose, your main Prisma workflow might look different.
196196

197-
### SQL migrations and introspection
197+
### Prisma Migrate
198198

199-
The typical workflow when using **SQL migrations and introspection** looks as follows:
199+
With **Prisma Migrate**, Prisma's integrated database migration tool, the workflow looks as follows:
200200

201-
1. Manually adjust your database schema using SQL
202-
1. (Re-)introspect your database
203-
1. Optionally (re-)configure your Prisma Client API ([learn more](../../components/prisma-client/configuring-the-prisma-client-api))
204-
1. (Re-)generate Prisma Client
201+
1. Manually adjust your [Prisma data model](../../components/prisma-schema/data-model)
202+
1. Migrate your development database using the `prisma migrate dev` CLI command
205203
1. Use Prisma Client in your application code to access your database
206204

207-
![Introspection workflow](https://imgur.com/ToNkpb2.png)
205+
![Typical workflow with Prisma Migrate](../../../doc-images/prisma-migrate-development-workflow.png)
208206

209-
### Prisma Migrate
207+
To learn more about the Prisma Migrate workflow, please refer the [flows guide](../components/prisma-migrate/prisma-migrate-flows).
210208

211-
With **Prisma Migrate**, the workflow looks slightly different:
209+
### SQL migrations and introspection
212210

213-
1. Manually adjust your [Prisma data model](../../components/prisma-schema/data-model)
214-
1. Migrate your database using the `prisma migrate` CLI commands
211+
If for some reasons, you can not or do not want to use Prisma Migrate, you can still use introspection to pull changes update your Prisma schema from your database schema.
212+
The typical workflow when using **SQL migrations and introspection** is slightly different:
213+
214+
1. Manually adjust your database schema using SQL or a third-party migration tool
215+
1. (Re-)introspect your database
216+
1. Optionally (re-)configure your Prisma Client API ([learn more](../../components/prisma-client/configuring-the-prisma-client-api))
215217
1. (Re-)generate Prisma Client
216218
1. Use Prisma Client in your application code to access your database
217219

218-
![Typical workflow with Prisma Migrate](https://imgur.com/OImder6.png)
220+
![Introspection workflow](../../../doc-images/prisma-introspection-development-workflow.png)
221+
222+
To learn more about the introspection workflow, please refer the [introspection section](../components/introspection).
219223

220-
To dive deeper, please refer to the respective docs page.

content/200-concepts/100-components/01-prisma-schema/04-data-model.mdx

+1-3
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,9 @@ Your data model reflects *your* application domain. For example:
195195

196196
There are two ways to define a data model:
197197

198-
- **Write the model manually and use Prisma Migrate**: You can write your data model manually and map it to your database using [Prisma Migrate](../prisma-migrate) (Experimental). In this case, the data model is the single source of truth for the models of your application.
198+
- **Write the model manually and use Prisma Migrate**: You can write your data model manually and map it to your database using [Prisma Migrate](../prisma-migrate) (Preview). In this case, the data model is the single source of truth for the models of your application.
199199
- **Generate the model via introspection**: When you have an existing database or prefer migrating your database schema with SQL, you generate the data model by [introspecting](../introspection) your database. In this case, the database schema is the single source of truth for the models of your application.
200200

201-
> **Note**: Since [Prisma Migrate](../prisma-migrate) is currently in an Experimental state, the officially recommended way for using Prisma is the introspection-based approach.
202-
203201
## Defining models
204202

205203
Models represent the entities of your application domain. Models are represented by [`model`](../../../reference/api-reference/prisma-schema-reference#model) <span class="api"></span> blocks and define a number of [fields](../../../reference/api-reference/prisma-schema-reference#model-fields). In the [example data model](data-model), `User`, `Profile`, `Post` and `Category` are models.
Loading
Loading

0 commit comments

Comments
 (0)