prostargram-2
Tables (18)
BADWORDS (Untitled)
- name — VARCHAR(100) — Primary key — NOT NULL
CHOICE
- option_id — INT UNSIGNED — Foreign key → POST_OPTIONS.option_id — NOT NULL
- user_id — INT UNSIGNED — Foreign key → USERS.user_id — NOT NULL
- post_id — INT UNSIGNED — Foreign key → POST_OPTIONS.option_id — NOT NULL
COMMENT
- comment_id — INT UNSIGNED — Primary key — NOT NULL
- user_id — INT UNSIGNED — Foreign key → USERS.user_id — NOT NULL
- post_id — INT UNSIGNED — Foreign key → POST.post_id — NOT NULL
- parent_id — INT UNSIGNED
- content — VARCHAR(300) — NOT NULL
- like_count — INT UNSIGNED — NOT NULL
- created_at — TIMESTAMP — NOT NULL
COMMENT_LIKE (LIKE_OF_COMMENT)
- user_id — INT UNSIGNED — Foreign key → USERS.user_id — NOT NULL
- comment_id — INT UNSIGNED — NOT NULL
FILE_EXTENSION (Untitled2)
- extension (Key) — varchar(20) — Primary key — NOT NULL
- type (Field) — varchar(20)
FOLLOW
- to_user_id (user_id2) — INT UNSIGNED — Foreign key → USERS.user_id — NOT NULL
- from_user_id (user_id) — INT UNSIGNED — Foreign key → USERS.user_id — NOT NULL
HASHTAGS
- hashtag_id — INT UNSIGNED — Primary key — NOT NULL
- name — VARCHAR(15) — NOT NULL
HYPER_LINK
- link_id — INT UNSIGNED — Primary key — NOT NULL
- user_id — INT — Foreign key → USERS.user_id — NOT NULL
- link — TEXT — NOT NULL
- icon_id — INT UNSIGNED — Foreign key → LINK_ICON.icon_id — NOT NULL
INTERESTS
- user_id — INT UNSIGNED — Foreign key → USERS.user_id — NOT NULL
- hashtag_id — INT UNSIGNED — Foreign key → HASHTAGS.hashtag_id — NOT NULL
LINK_ICON
- icon_id — INT UNSIGNED — Primary key — NOT NULL
- img_url (TEXT) — TEXT
- domain — VARCHAR(20)
ORGANIZATION
- organization_id — INT UNSIGNED — Primary key — NOT NULL
- name — VARCHAR(40) — NOT NULL
POLL_METADATA
- statistics_id — INT UNSIGNED — Primary key — NOT NULL
- post_id — INT UNSIGNED — Foreign key → POST.post_id — NOT NULL
- start_time — DATE
- end_time — DATE
- allow_multiple_votes (Field) — TINIYINT(1)
POST
- post_id — INT UNSIGNED — Primary key — NOT NULL
- user_id — INT UNSIGNED — Foreign key → USERS.user_id — NOT NULL
- content — TEXT
- like_count — INT UNSIGNED
- comment_count — INT UNSIGNED
- type — VARCHAR(10) — 무슨 종류의 post인지
- created_at — TIMESTAMP — POST가 언제 생성되었는지, created_at은 관례를 따라 지음
POST_IMAGE
- image_id — INT UNSIGNED — Primary key — NOT NULL
- post_id — INT UNSIGNED — Foreign key → POST.post_id — NOT NULL
- img_url — TEXT — NOT NULL
POST_LIKE
- user_id — INT — Foreign key → USERS.user_id — NOT NULL
- post_id — INT UNSIGNED — Foreign key → POST.post_id — NOT NULL
POST_OPTIONS
- option_id — INT UNSIGNED — Primary key — NOT NULL
- post_id — INT UNSIGNED — Foreign key → POST.post_id — NOT NULL
- content — CHAR(40) — NOT NULL
POST__HASHTAG_MAPPING (POST_HASHTAG_MAPPING)
- post_id — INT UNSIGNED — Foreign key → POST.post_id — NOT NULL
- hashtag_id — INT UNSIGNED — Foreign key → HASHTAGS.hashtag_id — NOT NULL
USERS
- user_id — INT UNSIGNED — Primary key — NOT NULL
- organization_id — INT UNSIGNED — Foreign key → ORGANIZATION.organization_id — NOT NULL
- user_name — VARCHAR(20)
- email — VARCHAR(320) — NOT NULL — 이메일 최대길이 320자 이하로 체크 로직 필요
- password — VARCHAR(60) — github 연동 회원가입은 password가 필요 없음
- self_introduction — TEXT — 자기소개 300자 이하로 체크 로직 필요
- profile_img_url — TEXT — NOT NULL — /카톡 프사 이미지 기본으로 넣을꺼임
- post_count — INT UNSIGNED — NOT NULL
- follower_count — INT UNSIGNED — NOT NULL
- following_count — INT UNSIGNED — NOT NULL
- type (type(관리자, 일반유저 여부)) — CHAR(21) — NOT NULL — 영구정지(permanently suspended), 정지(suspended), 정상(ACTIVE)
- login_type — CHAR(6) — NOT NULL — GITHUB,NORMAL