@@ -6,63 +6,69 @@ Project find_it {
66Enum item_category {
77 ELECTRONICS [note: '전자기기']
88 WALLET [note: '지갑']
9- BAG [note: '가방']
10- CLOTHING [note: '의류']
11- ACCESSORIES [note: '액세서리']
12- DOCUMENT [note: '서류']
13- CARD [note: '카드']
14- OTHER [note: '기타']
9+ BAG [note: '가방']
10+ CLOTHING [note: '의류']
11+ ACCESSORIES [note: '액세서리']
12+ DOCUMENT [note: '서류']
13+ CARD [note: '카드']
14+ ETC [note: '기타']
1515}
1616
1717Enum post_status {
18- PENDING [note: '미해결 ']
18+ IN_PROGRESS [note: '진행 중 ']
1919 RESOLVED [note: '해결됨']
20+ CANCELLED [note: '취소됨']
21+ }
22+
23+ Enum post_type {
24+ FOUND [note: '발견']
25+ LOST [note: '분실']
26+ }
27+
28+ Enum comment_type {
29+ COMMENT [note: '일반 댓글']
30+ REPLY [note: '대댓글']
2031}
2132
2233Table users {
2334 uuid uuid [pk, not null]
2435 name varchar [not null]
25- email varchar [not null, unique]
2636 created_at timestamp [not null, default: `now()`]
2737 updated_at timestamp [not null]
2838
2939 Note: '사용자 정보'
3040}
3141
32- Table found_posts {
33- id uuid [pk, not null, default: `gen_random_uuid()`]
34- title varchar [not null]
35- description text [not null]
42+ Table posts {
43+ id serial [pk, not null]
44+ type post_type [not null, note: '게시글 타입 (발견/분실)']
45+ title varchar(255) [not null, note: '게시글 제목']
46+ description text [not null, note: '게시글 설명']
3647 images varchar[] [note: '이미지 URL 배열']
37- location varchar [not null, note: '발견 장소']
38- category item_category [not null]
39- status post_status [not null, default: 'PENDING']
40- author_id uuid [ref: > users.uuid, not null]
48+ location varchar [not null, note: '발견/분실 장소']
49+ category item_category [not null, default: 'ETC', note: '아이템 카테고리']
50+ status post_status [not null, note: '게시글 상태']
4151 created_at timestamp [not null, default: `now()`]
4252 updated_at timestamp [not null]
53+ deleted_at timestamp [note: '게시글 삭제 일자']
54+ author_id uuid [ref: > users.uuid, not null, note: '작성자 UUID']
4355
4456 indexes {
4557 author_id
4658 }
4759
48- Note: '발견 게시글'
60+ Note: '게시글 정보 '
4961}
5062
51- Table lost_posts {
52- id uuid [pk, not null, default: `gen_random_uuid()`]
53- title varchar [not null]
54- description text [not null]
55- images varchar[] [note: '이미지 URL 배열']
56- location varchar [not null, note: '분실 추정 장소']
57- category item_category [not null]
58- status post_status [not null, default: 'PENDING']
59- author_id uuid [ref: > users.uuid, not null]
63+ Table comments {
64+ id serial [pk, not null]
65+ content text [not null, note: '댓글 내용']
66+ type comment_type [not null, note: '댓글 타입 (댓글/대댓글)']
6067 created_at timestamp [not null, default: `now()`]
61- updated_at timestamp [not null]
68+ is_deleted boolean [not null, default: false, note: '댓글 삭제 여부']
69+ post_id int [ref: > posts.id, not null, note: '게시글 ID']
70+ author_id uuid [ref: > users.uuid, not null, note: '작성자 UUID']
71+ parent_id int [ref: > comments.id, note: '상위 댓글 ID']
6272
63- indexes {
64- author_id
65- }
66-
67- Note: '분실 게시글'
68- }
73+ Note: '댓글 정보'
74+ }
0 commit comments