You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/200-concepts/050-overview/100-what-is-prisma/index.mdx
+17-14
Original file line number
Diff line number
Diff line change
@@ -80,8 +80,8 @@ The data model is a collection of [models](../../components/prisma-schema/data-m
80
80
81
81
There are two major workflows for "getting" a data model into your Prisma schema:
82
82
83
-
- Generating the data model from [introspecting](../../components/introspection) a database
84
83
- 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
85
85
86
86
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).
87
87
@@ -194,27 +194,30 @@ Note that when using TypeScript, the result of this query will be _statically ty
194
194
195
195
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.
196
196
197
-
### SQL migrations and introspection
197
+
### Prisma Migrate
198
198
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:
200
200
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
205
203
1. Use Prisma Client in your application code to access your database

208
206
209
-
### Prisma Migrate
207
+
To learn more about the Prisma Migrate workflow, please refer the [flows guide](../components/prisma-migrate/prisma-migrate-flows).
210
208
211
-
With **Prisma Migrate**, the workflow looks slightly different:
209
+
### SQL migrations and introspection
212
210
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))
215
217
1. (Re-)generate Prisma Client
216
218
1. Use Prisma Client in your application code to access your database
217
219
218
-

Copy file name to clipboardExpand all lines: content/200-concepts/100-components/01-prisma-schema/04-data-model.mdx
+1-3
Original file line number
Diff line number
Diff line change
@@ -195,11 +195,9 @@ Your data model reflects *your* application domain. For example:
195
195
196
196
There are two ways to define a data model:
197
197
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.
199
199
-**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.
200
200
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
-
203
201
## Defining models
204
202
205
203
Models represent the entities of your application domain. Models are represented by [`model`](../../../reference/api-reference/prisma-schema-reference#model) <spanclass="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.
0 commit comments