JeAri
테이블 (7)
게시글 (Post)
- 식별자 (id) — serial — 기본 키 — NOT NULL — auto increase
- 제목 (title) — varchar(50) — NOT NULL
- 내용 (content) — text — NOT NULL
- 작성일 (created_at) — timestamptz
- 조회수 (view) — int
- 동아리 식별자 (club_id) — serial — 외래 키 → 동아리 테이블.식별자 — NOT NULL
- 작성자 (membership_id) — serial — 외래 키 → 소속 동아리.식별자 — ON DELETE SET NULL
댓글 (Comment)
- 식별자 (comment_id) — serial — 기본 키 — NOT NULL — auto increase
- 내용 (content) — text — NOT NULL
- 작성일 (created_at) — timestamptz
- 게시글 식별자 (post_id) — serial — 외래 키 → 게시글.식별자 — NOT NULL — ON DELETE CASCADE
- 작성자 (user_id) — serial — 외래 키 → 유저테이블.식별자 — NOT NULL — ON DELETE SET NULL
동아리 가입 신청 (JoinRequest)
- 식별자 (request_id) — serial — 기본 키 — NOT NULL — auto increase
- 답변 (answer) — text — NOT NULL
- 신청 시각 (created_at) — timestamptz
- 진행 상황 (status) — ENUM — [pendding, accepted, rejected]
- 유저 식별자 (user_id) — serial — 외래 키 → 유저테이블.식별자 — NOT NULL — [unique: user_id, recruitment_id]
- 식별자 (Recruitment_key) — serial — 외래 키 → 모집 공고.식별자 — NOT NULL — [unique: user_id, recruitment_id]
동아리 테이블 (Club)
- 식별자 (club_id) — serial — 기본 키 — NOT NULL — auto increase
- 동아리명 (name) — varchar(50) — NOT NULL — UNIQUE
- 소개글 (description) — text
- 카테고리 (category) — ENUM
- 하위 카테고리 (subcategory) — varchar(15)
모집 공고 (Recruitment)
- 식별자 (recruitment_id) — serial — 기본 키 — NOT NULL
- 작성 시간 (created_at) — timestamptz
- 모집 시작일 (start_date) — date — NOT NULL
- 모집 마감일 (end_date) — date
- 진행 상황 (status) — ENUM — NOT NULL — [open, closed]
- 공고 제목 (recruit_title) — varchar(100) — NOT NULL
- 모집 안내글 (recruit_info) — text
- 질문 (question) — text
- 식별자 (club_id) — serial — 외래 키 → 동아리 테이블.식별자 — NOT NULL — auto increase
소속 동아리 (ClubMembership)
- 식별자 (membership_id) — serial — 기본 키 — NOT NULL — auto increase
- 동아리 역할 (club_role) — ENUM — [president, vice_president, media_manager, member]
- 가입일 (joined_at) — date
- 동아리 식별자 (club_id) — serial — 외래 키 → 동아리 테이블.식별자 — NOT NULL — UNIQUE ("user_id", "club_id");
- 유저 식별자 (user_id) — serial — 외래 키 → 유저테이블.식별자 — NOT NULL — UNIQUE ("user_id", "club_id");
유저테이블 (User)
- 식별자 (user_id) — serial — 기본 키 — NOT NULL — auto increase
- 이름 (name) — varchar(30) — NOT NULL
- 학번 (student_id) — varchar(10) — NOT NULL — UNIQUE
- 비밀번호 (pw_hash) — text — NOT NULL
- 권한 (user_role) — EUNM — [user, admin]
- 이메일 (email) — varchar(255) — NOT NULL — UNIQUE,학교 메일 인증용