hasi_ERD
Tables (19)
Boards
- id — BIGINT — Primary key — NOT NULL — 보드 식별자
- workspace_id — BIGINT — Foreign key → Workspaces.id — NOT NULL — 소속 워크스페이스
- name — VARCHAR(100) — NOT NULL — 보드 이름
- created_at — TIMESTAMP — NOT NULL — 생성 시각
- updated_at — TIMESTAMP — NOT NULL — 수정 시각
Bookmarks
- id — BIGINT — Primary key — NOT NULL — 북마크 식별자
- user_id — BIGINT — Foreign key → Users.id — NOT NULL — 북마크한 사용자
- message_id — BIGINT — Foreign key → Messages.id — 메시지 북마크
- file_id — BIGINT — Foreign key → Files.id — 파일 북마크
- created_at — TIMESTAMP — NOT NULL — 북마크 시각
Channel_Members
- channel_id — BIGINT — Foreign key → Channels.id — NOT NULL — 소속 채널
- user_id — BIGINT — Foreign key → Users.id — NOT NULL — 멤버 사용자
- role — ENUM('admin', 'member') — NOT NULL — 권한
- joined_at — TIMESTAMP — NOT NULL — 가입 시각
Channels
- id — BIGINT — Primary key — NOT NULL — 채널 식별자
- workspace_id — BIGINT — Foreign key → Workspaces.id — NOT NULL — 소속 워크스페이스
- name — VARCHAR(100) — NOT NULL — 채널 이름
- is_private — BOOLEAN — NOT NULL — 공개/비공개
- created_at — TIMESTAMP — NOT NULL — 생성 시각
DM_Room_Members
- room_id — BIGINT — Foreign key → DM_Rooms.id — NOT NULL — 소속 DM 방
- user_id — BIGINT — Foreign key → Users.id — NOT NULL — 참여 사용자
- joined_at — TIMESTAMP — NOT NULL — 참여 시각
DM_Rooms
- id — BIGINT — Primary key — NOT NULL — DM 방 식별자
- created_at — TIMESTAMP — NOT NULL — 생성 시각
Files
- id — BIGINT — Primary key — NOT NULL — 파일 식별자
- uploader_id — BIGINT — Foreign key → Users.id — NOT NULL — 업로드한 사용자
- channel_id — BIGINT — Foreign key → Channels.id — 채널 첨부
- dm_room_id — BIGINT — Foreign key → DM_Rooms.id — DM 첨부
- url — VARCHAR(512) — NOT NULL — 스토리지 URL (S3/MinIO)
- thumbnail_url — VARCHAR(512) — 이미지 미리보기 URL
- original_name — VARCHAR(255) — NOT NULL — 원본 파일명
- mime_type — VARCHAR(100) — NOT NULL — MIME 타입
- size — BIGINT — NOT NULL — 파일 크기 (bytes)
- is_deleted — BOOLEAN — NOT NULL — 소프트 삭제 여부
- created_at — TIMESTAMP — NOT NULL — 업로드 시각
Friends
- user_id — BIGINT — Foreign key → Users.id — NOT NULL — 신청자
- friend_id — BIGINT — Foreign key → Users.id — NOT NULL — 수신자
- status — ENUM('pending', 'accepted', 'blocked') — NOT NULL — 관계 상태
- created_at — TIMESTAMP — NOT NULL — 신청 시각
Message_Reactions
- msg_id — BIGINT — Foreign key → Messages.id — NOT NULL — 메시지
- user_id — BIGINT — Foreign key → Users.id — NOT NULL — 반응한 사용자
- stamp_id — BIGINT — Foreign key → Stamps.id — NOT NULL — 스탬프 종류
Message_Reads
- message_id — BIGINT — Foreign key → Messages.id — NOT NULL — 어떤 메시지
- user_id — BIGINT — Foreign key → Users.id — NOT NULL — 누가 읽었는지
- is_read — BOOLEAN — NOT NULL — 읽음 여부
- delivered_at — TIMESTAMP — 수신자 기기 도달 시각 (2차 예약)
- read_at — TIMESTAMP — 실제 읽은 시각 — 既読 N 기준
Messages
- id — BIGINT — Primary key — NOT NULL — 메시지 식별자
- channel_id — BIGINT — Foreign key → Channels.id — 채널 메시지 (channel/dm 중 하나 NN)
- dm_room_id — BIGINT — Foreign key → DM_Rooms.id — DM 메시지
- sender_id — BIGINT — Foreign key → Users.id — NOT NULL — 발신자
- parent_msg_id — BIGINT — Foreign key → Messages.id — 스레드 부모 (자기참조)
- content — TEXT — NOT NULL — 메시지 내용
- sent_at — TIMESTAMP — NOT NULL — 클라이언트 전송 시각 (화면 표시용)
- all_read — BOOLEAN — NOT NULL — 전원 읽음 — 完 태그용
- is_deleted — BOOLEAN — NOT NULL — 소프트 삭제 여부
- deleted_at — TIMESTAMP — 삭제 시각
- created_at — TIMESTAMP — NOT NULL — 서버 저장 시각 (정렬용)
- updated_at — TIMESTAMP — NOT NULL — 수정 시각
Notifications
- id — BIGINT — Primary key — NOT NULL — 알림 식별자
- user_id — BIGINT — Foreign key → Users.id — NOT NULL — 수신자
- message_id — BIGINT — Foreign key → Messages.id — 관련 메시지 (멘션 등)
- type — VARCHAR(50) — NOT NULL — mention/reaction/system
- is_read — BOOLEAN — NOT NULL — 읽음 여부
- created_at — TIMESTAMP — NOT NULL — 생성 시각
Pinned_Messages
- channel_id — BIGINT — Foreign key → Channels.id — NOT NULL — 핀이 있는 채널
- message_id — BIGINT — Foreign key → Messages.id — NOT NULL — 핀된 메시지
- pinned_by — BIGINT — Foreign key → Users.id — NOT NULL — 핀 등록자 (관리자)
- created_at — TIMESTAMP — NOT NULL — 핀 등록 시각
Stamps
- id — BIGINT — Primary key — NOT NULL — 스탬프 식별자
- name — VARCHAR(50) — NOT NULL — 스탬프 이름 (일본어)
- emoji — VARCHAR(10) — NOT NULL — 이모지 문자
- category — VARCHAR(50) — NOT NULL — business/celebration/etc
- sort_order — INT — NOT NULL — 표시 순서
Tasks
- id — BIGINT — Primary key — NOT NULL — 태스크 식별자
- board_id — BIGINT — Foreign key → Boards.id — NOT NULL — 소속 보드
- assignee_id — BIGINT — Foreign key → Users.id — 담당자
- title — VARCHAR(200) — NOT NULL — 태스크 제목
- description — TEXT — 상세 내용
- status — ENUM('todo', 'in_progress', 'done') — NOT NULL — 진행 상태
- priority — ENUM('low', 'medium', 'high') — NOT NULL — 우선순위
- due_date — DATE — 마감일
- order_index — INT — NOT NULL — 칸반 열 내 순서
- created_at — TIMESTAMP — NOT NULL — 생성 시각
- updated_at — TIMESTAMP — NOT NULL — 수정 시각
User_Preferences
- user_id — BIGINT — Foreign key → Users.id — NOT NULL — 사용자 (1:1)
- theme — ENUM('light', 'dark', 'system') — NOT NULL — 테마
- tab_layout — JSON — 탭 레이아웃 설정
- updated_at — TIMESTAMP — NOT NULL — 설정 수정 시각
Users
- id — BIGINT — Primary key — NOT NULL — 사용자 식별자
- email — VARCHAR(255) — NOT NULL — 로그인 이메일
- password_hash — VARCHAR(255) — 소셜 로그인 시 NULL
- nickname — VARCHAR(50) — NOT NULL — 표시 이름
- avatar_url — VARCHAR(512) — 프로필 이미지 URL
- status_code — ENUM('online', 'away', 'busy', 'offline', 'outside', 'remote') — NOT NULL — 현재 상태
- status_message — VARCHAR(100) — 상태 메시지
- dnd_start_time — TIME — DND 시작 시각
- dnd_end_time — TIME — DND 종료 시각
- email_verified — BOOLEAN — NOT NULL — 이메일 인증 완료 여부
- email_verify_token — VARCHAR(64) — 인증코드 (10분 유효)
- token_expires_at — TIMESTAMP — 토큰 만료 시각
- is_active — BOOLEAN — NOT NULL — 계정 활성 여부
- is_admin — BOOLEAN — NOT NULL — 시스템 관리자
- created_at — TIMESTAMP — NOT NULL — 가입 시각
- updated_at — TIMESTAMP — NOT NULL — 수정 시각
Workspace_Members
- workspace_id — BIGINT — Foreign key → Workspaces.id — NOT NULL — 소속 워크스페이스
- user_id — BIGINT — Foreign key → Users.id — NOT NULL — 멤버 사용자
- role — ENUM('owner', 'admin', 'member') — NOT NULL — 권한
- joined_at — TIMESTAMP — NOT NULL — 가입 시각
Workspaces
- id — BIGINT — Primary key — NOT NULL — 워크스페이스 식별자
- owner_id — BIGINT — Foreign key → Users.id — NOT NULL — 생성자
- name — VARCHAR(100) — NOT NULL — 이름
- is_private — BOOLEAN — NOT NULL — 공개/비공개
- icon_url — VARCHAR(512) — 대표 이미지 URL
- description — TEXT — 설명
- created_at — TIMESTAMP — NOT NULL — 생성 시각
- updated_at — TIMESTAMP — NOT NULL — 수정 시각