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
@@ -12,104 +12,110 @@ Make sure you followed the [Getting Started](/getting-started) before starting t
12
12
Let's dive into creating a full new entity with database, backend and ui.<br />
13
13
We will create a **"Project"** entity with the full CRUD (Create Read Update Delete) screens.
14
14
15
-
## Step 1: Create the Project database schema
15
+
## Step 1: Create the _Project_ model in the schema
16
16
17
17
<Steps>
18
18
19
19
1. Update the Prisma Database Schema
20
20
21
-
We will use [Prisma](https://www.prisma.io/docs/concepts/components/prisma-schema/data-model) to add the project entity to our database schema.<br />
22
-
23
-
Because we are creating a new entity, we need to create a new file to store all details related to the new `Project` model.
21
+
We will use [Prisma](https://www.prisma.io/docs/concepts/components/prisma-schema/data-model) to add the _Project_ model to our database schema.
24
22
25
23
Update the `prisma/schema.prisma` file and add a new model called `Project` with the following fields.
26
24
27
25
```prisma filename="prisma/schema.prisma"
28
26
model Project {
29
-
id String @id @default(cuid())
30
-
createdAt DateTime @default(now())
31
-
updatedAt DateTime @updatedAt
32
-
name String @unique
33
-
description String?
27
+
id String @id @default(cuid())
28
+
createdAt DateTime @default(now())
29
+
updatedAt DateTime @updatedAt
30
+
name String @unique
31
+
description String?
34
32
}
35
33
```
36
34
37
-
Cut the running `pnpm dev{:bash}` if needed, and then run the `pnpm db:push{:bash}` command to update your database.
38
-
39
-
You can run `pnpm dev{:bash}` again.
35
+
Run `pnpm db:push` command to update your database.
40
36
41
37
2. Create you first project
42
38
43
-
We can see what is inside of our database with the `pnpm db:ui{:bash}` command.<br />
39
+
We can see what is inside of our database with the `pnpm db:ui` command (accessible on <ahref="http://localhost:5555"target="_blank">localhost:5555</a>)
44
40
You should see your `Project` model and be able to create a new project like the following.
0 commit comments