2단계 (친구 - 전체공개)
테이블 (9)
Comment (댓글)
- comment_id — Bigint — 기본 키 — NOT NULL
- memo_id — Bigint — 외래 키 → Memo.memo_id — NOT NULL
- user_id — Bigint — 외래 키 → User.user_id — NOT NULL — 사용자 고유 ID
- content — Varchar(255) — NOT NULL
- is_deleted — boolean
- created_at — TimeStamp — NOT NULL
- deleted_at — TimeStamp
- parent_comment_id — Bigint — 외래 키 → Comment.comment_id — NOT NULL — 대댓글 구현
- Field
Mate (친구)
- id — Bigint — 기본 키 — NOT NULL
- status — Enum — NOT NULL — 친구 요청 상태 (pending/accepted/rejected/cancled)
- from_user_id — Bigint — 외래 키 → User.user_id — NOT NULL — 친구 요청 사용자
- to_user_id — Bigint — 외래 키 → User.user_id — NOT NULL — 친구 요청 대상 사용자
- created_at — TimeStamp — NOT NULL
- deleted_at — TimeStamp
Memo (기록)
- memo_id — Bigint — 기본 키 — NOT NULL
- node_id — Bigint — 외래 키 → Node.node_id — NOT NULL
- user_id — Bigint — 외래 키 → User.user_id — NOT NULL — 사용자 고유 ID
- content — Varchar(255) — NOT NULL
- is_deleted — boolean
- created_at — TimeStamp — NOT NULL
- deleted_at — TimeStamp
Node
- node_id — Bigint — 기본 키 — NOT NULL
- name — Varchar(50) — NOT NULL — 노드 이름(키워드 바탕 추출)
- created_at — TimeStamp — NOT NULL
- is_deleted — boolean
- deleted_at — TimeStamp
- node_img — Varchar(255)
NodeRelation (관게-노드)
- node_relation_id — Bigint — 기본 키 — NOT NULL
- Relation_id — Bigint — 외래 키 → Relation.Relation_id — NOT NULL
- from_node_id — Bigint — 외래 키 → Node.node_id — NOT NULL
- to_node_id — Bigint — 외래 키 → Node.node_id — NOT NULL
- user_id — Bigint — 외래 키 → User.user_id — NOT NULL — 사용자 고유 ID
- is_active — boolean
- canceled_at — TimeStamp
- created_at — TimeStamp
Relation (관계)
- Relation_id — Bigint — 기본 키 — NOT NULL
- created_at — TimeStamp — NOT NULL
RelationToType (관계-관계타입 중간테이블)
- Relation_id — Bigint — 외래 키 → Relation.Relation_id — NOT NULL
User (회원 정보)
- user_id — Bigint — 기본 키 — NOT NULL — 사용자 고유 ID
- email (emai) — Varchar(255) — NOT NULL
- password — Varchar(255) — NOT NULL
- nickname — Varchar(50) — NOT NULL
- profile_img — Varchar(255)
- created_at — TimeStamp — NOT NULL
UserNodeRelation (유저-노드 관계)
- user_node_id — Bigint — 기본 키 — NOT NULL
- node_id — Bigint — 외래 키 → Node.node_id — NOT NULL
- user_id — Bigint — 외래 키 → User.user_id — NOT NULL — 접근 권한 보유 유저
- created_at — TimeStamp — NOT NULL
- is_canceld — boolean
- canceled_at — TimeStamp
- relation_type — Varchar(50) — NOT NULL