Skip to content

Commit 8e14eed

Browse files
committed
docs: erd 추가
1 parent 36921a9 commit 8e14eed

1 file changed

Lines changed: 85 additions & 0 deletions

File tree

docs/week2/04-erd.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
## ERD
2+
3+
---
4+
```mermaid
5+
erDiagram
6+
USER ||--o{ POINT : holds
7+
USER ||--o{ LIKE : likes
8+
USER ||--o{ ORDER : places
9+
10+
ORDER ||--|{ ORDER_ITEM : contains
11+
PRODUCT ||--o{ ORDER_ITEM : includes
12+
BRAND ||--o{ PRODUCT : owns
13+
PRODUCT ||--o{ LIKE : is_liked_by
14+
15+
USER {
16+
BIGINT id PK
17+
VARCHAR(100) user_id
18+
VARCHAR(255) email
19+
DATE birthdate
20+
INT gender
21+
TIMESTAMP created_at
22+
TIMESTAMP updated_at
23+
TIMESTAMP deleted_at
24+
}
25+
26+
POINT {
27+
BIGINT id PK
28+
BIGINT ref_user_id FK
29+
BIGINT value
30+
TIMESTAMP created_at
31+
TIMESTAMP updated_at
32+
TIMESTAMP deleted_at
33+
}
34+
35+
LIKE {
36+
BIGINT id PK
37+
BIGINT ref_user_id FK
38+
BIGINT ref_product_id FK
39+
TIMESTAMP created_at
40+
TIMESTAMP updated_at
41+
TIMESTAMP deleted_at
42+
}
43+
44+
ORDER {
45+
BIGINT id PK
46+
BIGINT ref_user_id FK
47+
INT status
48+
TIMESTAMP created_at
49+
TIMESTAMP updated_at
50+
TIMESTAMP deleted_at
51+
}
52+
53+
PRODUCT {
54+
BIGINT id PK
55+
BIGINT ref_brand_id FK
56+
VARCHAR name
57+
VARCHAR description
58+
BIGINT price
59+
INT stock
60+
TIMESTAMP created_at
61+
TIMESTAMP updated_at
62+
TIMESTAMP deleted_at
63+
}
64+
65+
BRAND {
66+
BIGINT id PK
67+
VARCHAR name
68+
VARCHAR description
69+
TIMESTAMP created_at
70+
TIMESTAMP updated_at
71+
TIMESTAMP deleted_at
72+
}
73+
74+
ORDER_ITEM {
75+
BIGINT id PK
76+
BIGINT ref_product_id FK
77+
BIGINT ref_order_id FK
78+
INT quantity
79+
BIGINT price
80+
TIMESTAMP created_at
81+
TIMESTAMP updated_at
82+
TIMESTAMP deleted_at
83+
}
84+
85+
```

0 commit comments

Comments
 (0)