Video-Platform

Tables (13)

BOOKMARKS (북마크)

  • user_id (유저 아이디) — Bigint — Foreign key → USERS.id — NOT NULL
  • video_id (비디오 아이디) — Bigint — Foreign key → VIDEOS.id — NOT NULL
  • — Foreign key → VIDEOS.user_id — NOT NULL
  • . — Foreign key → VIDEOS.category_id — NOT NULL
  • created_at (생성 날짜) — Datetime — NOT NULL

CATEGORIES (카테고리)

  • id (카테고리 아이디) — Bigint — Primary key — NOT NULL
  • name (카테고리 이름) — Varchar — NOT NULL
  • display_order (순서) — int — NOT NULL
  • active (활성화 여부) — Boolean — NOT NULL
  • created_at (생성 날짜) — Datetime — NOT NULL

COMMENTS (댓글)

  • id (댓글 아이디) — Bigint — Primary key — NOT NULL
  • user_id (유저 아이디) — Bigint — Foreign key → USERS.id — NOT NULL
  • video_id (비디오 아이디) — Bigint — Foreign key → VIDEOS.id — NOT NULL
  • parent_id (대댓글 아이디) — Bigint — Foreign key → VIDEOS.user_id — NOT NULL
  • — Foreign key → VIDEOS.category_id — NOT NULL
  • content (내용) — Text — NOT NULL
  • status (댓글 상태) — Varchar — NOT NULL
  • created_at (생성 날짜) — Datetime — NOT NULL
  • updated_at (수정 날짜) — Datetime
  • deleted_at (삭제 날짜) — Datetime — NOT NULL

COMMENT_REPORTS (댓글 신고)

  • id (댓글 신고 아이디) — Bigint — Primary key — NOT NULL
  • reporter_id (신고자 아이디) — Bigint — Foreign key → USERS.id — NOT NULL
  • comment_id (댓글 아이디) — Bigint — Foreign key → COMMENTS.id — NOT NULL
  • — Foreign key → COMMENTS.user_id — NOT NULL
  • . — Foreign key → COMMENTS.video_id — NOT NULL
  • .. — Foreign key → COMMENTS.parent_id — NOT NULL
  • ... — Foreign key → COMMENTS. — NOT NULL
  • reason (신고 이유) — Varchar — NOT NULL
  • description (신고 설명) — Text
  • status (신고 상태) — Varchar — NOT NULL
  • created_at (신고 날짜) — Datetime — NOT NULL
  • resolved_at (해결 날짜) — Datetime

NOTIFICATIONS (알림)

  • id (알림 아이디) — Bigint — Primary key — NOT NULL
  • actor_id (송신인 아이디) — Bigint — Primary key — NOT NULL
  • recipient_id (수신인 아이디) — Bigint — Foreign key → USERS.id — NOT NULL
  • type (알림 종리유) — Varchar — NOT NULL
  • resource_type (알림 종류) — Varchar — NOT NULL
  • resource_id (알림 종류 아이디) — Bigint — NOT NULL
  • message (메시지) — Varchar — NOT NULL
  • read_at (읽은 날짜) — Datetime
  • created_at (생성 날짜) — Datetime — NOT NULL
  • deleted_at (삭제 날짜) — Datetime

REFRESH_TOKENS (리프레시 토큰)

  • id (리프레시 토큰 아이디) — Bigint — Primary key — NOT NULL
  • user_id (유저 아이디) — Bigint — Foreign key → USERS.id — NOT NULL
  • token_hash (토큰 해시값) — Varchar — NOT NULL
  • expires_at (유효기간) — Datetime — NOT NULL
  • revoked_at (취소 날짜) — Datetime
  • created_at (생성 날짜) — Datetime — NOT NULL

USERS (유저)

  • id (아이디) — Bigint — Primary key — NOT NULL
  • email (이메일) — Varchar — NOT NULL
  • password_hash (비밀번호 해시 값) — Varchar — NOT NULL
  • nickname (닉네임) — Varchar — NOT NULL
  • name (이름) — Varchar — NOT NULL
  • phone (전화번호) — Varchar — NOT NULL
  • status (유저 상태) — Varchar — NOT NULL
  • created_at (생성날짜) — Datetime — NOT NULL
  • updated_at (업데이트날짜) — Datetime
  • deleted_at (삭제날짜) — Datetime

VIDEOS (영상)

  • id (비디오 아이디) — Bigint — Primary key — NOT NULL
  • user_id (유저 아이디) — Bigint — Foreign key → USERS.id — NOT NULL
  • category_id (카테고리 아이디) — Bigint — Foreign key → CATEGORIES.id — NOT NULL
  • title (제목) — Varchar
  • visibility (공개여부) — Varchar — NOT NULL
  • status (상태) — Varchar — NOT NULL
  • video_url (비디오 URL) — Varchar — NOT NULL
  • thumbnail_url (썸네일 URL) — Varchar — NOT NULL
  • duration_seconds (영상길이) — int — NOT NULL
  • view_count (조회수) — Bigint — NOT NULL
  • like_count (좋아요 수) — Bigint — NOT NULL
  • published_at (업로드 날짜) — Datetime — NOT NULL
  • created_at (생성 날짜) — Datetime — NOT NULL
  • updated_at (업데이트 날짜) — Datetime — NOT NULL
  • deleted_at (삭제 날짜) — Datetime — NOT NULL

VIDEO_LIKES (좋아요)

  • user_id (유저 아이디) — Bigint — Foreign key → USERS.id — NOT NULL
  • video_id (비디오 아이디) — Bigint — Foreign key → VIDEOS.id — NOT NULL
  • — Foreign key → VIDEOS.user_id — NOT NULL
  • . — Foreign key → VIDEOS.category_id — NOT NULL
  • created_at (생성 날짜) — Datetime — NOT NULL

VIDEO_RENDITIONS (영상 화질)

  • id (영상 자막 아이디) — Bigint — Primary key — NOT NULL
  • video_id (비디오 아이디) — Bigint — Foreign key → VIDEOS.id — NOT NULL
  • .. — Foreign key → VIDEOS.user_id — NOT NULL
  • . — Foreign key → VIDEOS.category_id — NOT NULL
  • quality (화질) — Varchar — NOT NULL
  • stream_url (영상 URL) — Varchar — NOT NULL
  • codec (압축 방식) — Varchar — NOT NULL
  • file_size (파일 크기) — Bigint — NOT NULL
  • created_at (생성 날짜) — Datetime — NOT NULL

VIDEO_REPORTS (영상 신고)

  • id (영상 신고 아이디) — Bigint — Primary key — NOT NULL
  • reporter_id (신고자 아이디) — Bigint — Foreign key → USERS.id — NOT NULL
  • video_id (비디오 아이디) — Bigint — Foreign key → VIDEOS.id — NOT NULL
  • — Foreign key → VIDEOS.user_id — NOT NULL
  • . — Foreign key → VIDEOS.category_id — NOT NULL
  • reason (신고 이유) — Varchar — NOT NULL
  • description (신고 설명) — Text
  • status (신고 상태) — Varchar — NOT NULL
  • created_at (신고 날짜) — Datetime — NOT NULL
  • resolved_at (해결 날짜) — Datetime

VIDEO_SUBTITLES (Untitled)

  • id (영상 자막 아이디) — Bigint — Primary key — NOT NULL
  • video_id (비디오 아이디) — Bigint — Foreign key → VIDEOS.id — NOT NULL
  • — Foreign key → VIDEOS.user_id — NOT NULL
  • . — Foreign key → VIDEOS.category_id — NOT NULL
  • language_code (언어 코드) — Varchar — NOT NULL
  • label (라벨) — Varchar — NOT NULL
  • subtitle_url (자막 URL) — Varchar — NOT NULL
  • is_default (디폴트 여부) — Boolean — NOT NULL
  • created_at (생성 날짜) — Datetime — NOT NULL

WATCH_HISTORIES (시청 기록)

  • user_id (아이디) — Bigint — Foreign key → USERS.id — NOT NULL
  • video_id (비디오 아이디) — Bigint — Foreign key → VIDEOS.id — NOT NULL
  • . — Foreign key → VIDEOS.user_id — NOT NULL
  • .. — Foreign key → VIDEOS.category_id — NOT NULL
  • position_seconds (전체 길이) — int — NOT NULL
  • watched_seconds (시청 길이) — int — NOT NULL
  • view_counted (조회 횟수) — Boolean — NOT NULL
  • first_watched_at (첫 시청 날짜) — Datetime — NOT NULL
  • last_watched_at (마지막 시청 날짜) — Datetime
  • completed_at (완료 날짜) — Datetime