FitMate ERD

Tables (7)

comments

  • comment_id — BIGINT — Primary key — NOT NULL — 댓글 식별 번호
  • post_id — BIGINT — Foreign key → posts.post_id — NOT NULL — 게시글 식별 번호
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL — 사용자 식별 번호
  • parent_comment_id — BIGINT — Foreign key → comments.comment_id — 부모 댓글 번호
  • comment_content — TEXT — NOT NULL — 댓글 본문
  • comment_date_written — TIMESTAMP — NOT NULL — 댓글 작성 시각
  • is_having_child — BOOLEAN — NOT NULL — 대댓글 여부
  • is_blinded — BOOLEAN — NOT NULL — 댓글 표시 여부
  • created_at — TIMESTAMP — NOT NULL — 댓글 생성 일시
  • updated_at — TIMESTAMP — 댓글 수정 일시
  • deleted_at — TIMESTAMP — 댓글 삭제 일시

likes

  • like_id — BIGINT — Primary key — NOT NULL — 좋아요 식별 번호
  • post_id — BIGINT — Foreign key → posts.post_id — NOT NULL — 게시글 식별 번호
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL — 사용자 식별 번호

notifications

  • notification_id — BIGINT — Primary key — NOT NULL — 알림 식별 번호
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL — 알림 수신자 사용자 식별 번호
  • notification_type — VARCHAR(10) — NOT NULL — 알림 종류 (LIKE, COMMENT, BLIND)
  • post_id — BIGINT — Foreign key → posts.post_id — NOT NULL — 관련 게시글 식별 번호
  • actor_user_id — BIGINT — Foreign key → users.user_id — 알림 발생 행위자 사용자 식별 번호 (블라인드는 NULL)
  • comment_id — BIGINT — Foreign key → comments.comment_id — 관련 댓글 식별 번호 (댓글 알림만)
  • like_group_count — INT — NOT NULL — 좋아요 그룹 인원 수 (댓글·블라인드는 1 고정)
  • is_read — BOOLEAN — NOT NULL — 읽음 여부
  • group_created_at — TIMESTAMP — 좋아요 그룹 최초 생성 시각 (좋아요 알림만)
  • created_at — TIMESTAMP — NOT NULL — 알림 생성/그룹 갱신 일시
  • deleted_at — TIMESTAMP — 알림 소프트 삭제 일시

post_change_history

  • change_id — BIGINT — Primary key — NOT NULL — 게시글 수정 이력 식별번호
  • post_id — BIGINT — Foreign key → posts.post_id — NOT NULL — 게시글 식별 번호
  • changed_at — TIMESTAMP — NOT NULL — 게시글 수정 이력 시각
  • changed_title — VARCHAR(26) — NOT NULL — 게시글 제목 수정본
  • changed_content — TEXT — NOT NULL — 게시글 본문 수정본
  • changed_post_image — VARCHAR(512) — 게시글 이미지 수정본

post_report_history

  • report_id — BIGINT — Primary key — NOT NULL — 게시글 신고 식별 번호
  • post_id — BIGINT — Foreign key → posts.post_id — NOT NULL — 게시글 식별 번호
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL — 사용자 식별 번호
  • reported_at — TIMESTAMP — NOT NULL — 신고 시각

posts

  • post_id — BIGINT — Primary key — NOT NULL — 게시글 식별 번호
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL — 사용자 식별 번호
  • title — VARCHAR(26) — NOT NULL — 게시글 제목
  • content — TEXT — NOT NULL — 게시글 본문 내용
  • post_image — VARCHAR(512) — 게시글 이미지 URL
  • date_written — TIMESTAMP — NOT NULL — 게시글 작성 시각
  • post_hide — BOOLEAN — NOT NULL — 게시글 숨김 여부
  • is_edited — BOOLEAN — NOT NULL — 게시글 수정 여부
  • comment_count — BIGINT — NOT NULL — 댓글 수
  • view_count — BIGINT — NOT NULL — 조회수
  • like_count — BIGINT — NOT NULL — 좋아요 수
  • created_at — TIMESTAMP — NOT NULL — 게시글 생성 일시
  • updated_at — TIMESTAMP — 게시글 수정 일시
  • deleted_at — TIMESTAMP — 게시글 삭제 일시

users

  • user_id — BIGINT — Primary key — NOT NULL — 사용자 식별 번호
  • email — VARCHAR(320) — NOT NULL — 사용자 이메일
  • password — VARCHAR(100) — NOT NULL — 사용자 비밀번호
  • nickname — VARCHAR(10) — NOT NULL — 사용자 닉네임
  • profile_image — VARCHAR(512) — 사용자 프로필 이미지 URL
  • is_member — BOOLEAN — NOT NULL — 사용자 탈퇴 여부
  • created_at — TIMESTAMP — NOT NULL — 사용자 생성 일시
  • updated_at — TIMESTAMP — 사용자 정보 수정 일시
  • deleted_at — TIMESTAMP — 사용자 탈퇴 일시