Fandom-K ERD
Tables (12)
artist
- artist_id — BIGINT — Primary key — NOT NULL — 아티스트 ID
- name — VARCHAR(50) — NOT NULL — 이름
- gender — ENUM('M', 'F') — NOT NULL — 성별
- profile_image_url — TEXT — NOT NULL — 프로필 이미지 링크
- created_at — DATETIME — NOT NULL — 생성일
- updated_at — DATETIME — NOT NULL — 수정일
- group_id — BIGINT — Foreign key → artist_group.group_id — NOT NULL — 아티스트 그룹 ID
artist_group
- group_id — BIGINT — Primary key — NOT NULL — 아티스트 그룹 ID
- name — VARCHAR(50) — NOT NULL — 아티스트 그룹명
- created_at — DATETIME — NOT NULL — 생성일
- updated_at — DATETIME — NOT NULL — 수정일
chart
- chart_id — BIGINT — Primary key — NOT NULL — 차트 ID
- vote_count — INT — NOT NULL — 득표 수
- created_at — DATETIME — NOT NULL — 생성일
- chart_category_id — BIGINT — Foreign key → chart_category.chart_category_id — NOT NULL — 카테고리 ID
- artist_id (artist_id2) — BIGINT — Foreign key → artist.artist_id — NOT NULL — 아티스트 ID
chart_category
- chart_category_id — BIGINT — Primary key — NOT NULL — 카테고리 ID
- title — VARCHAR(100) — NOT NULL — 제목
- created_at — DATETIME — NOT NULL — 생성일
credit
- credit_id — BIGINT — Primary key — NOT NULL — 크레딧 ID
- balance — INT — NOT NULL — 현재 크레딧 잔액
- created_at — DATETIME — NOT NULL — 생성일
- updated_at — DATETIME — NOT NULL — 수정일
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL — 유저 ID / UNIQUE
credit_history
- history_id — BIGINT — Primary key — NOT NULL — 크레딧 이력 ID
- amount — INT — NOT NULL — 변동 크레딧
- type — ENUM('CHARGE', 'USE', 'REFUND') — NOT NULL — 변동 유형
- created_at — DATETIME — NOT NULL — 생성일
- payment_id (payment_id2) — BIGINT — Foreign key → payment.payment_id — NOT NULL — 결제 ID
- credit_id — BIGINT — Foreign key → credit.credit_id — NOT NULL — 크레딧 ID
donation
- donation_id — BIGINT — Primary key — NOT NULL — 조공 ID
- credit_amount — INT — NOT NULL — 금액
- created_at — DATETIME — NOT NULL — 생성일
- project_id — BIGINT — Foreign key → donation_project.project_id — NOT NULL — 프로젝트 ID
- user_id (user_id2) — BIGINT — Foreign key → users.user_id — NOT NULL — 유저 ID
donation_project
- project_id — BIGINT — Primary key — NOT NULL — 프로젝트 ID
- title — VARCHAR(100) — NOT NULL — 프로젝트 제목
- category — VARCHAR(50) — NOT NULL — 프로젝트 카테고리
- target_amount — INT — NOT NULL — 목표 금액
- current_amount — INT — NOT NULL — 현재 금액
- start_date — DATETIME — NOT NULL — 시작일
- end_date — DATETIME — NOT NULL — 종료일
- status — ENUM('PENDING','SUCCEED','FAILED') — NOT NULL — 프로젝트 상태
- image_url — TEXT — 이미지 링크
- created_at — DATETIME — NOT NULL — 생성일
- updated_at — DATETIME — NOT NULL — 수정일
- artist_id — BIGINT — Foreign key → artist.artist_id — NOT NULL — 아티스트 ID
payment
- payment_id — BIGINT — Primary key — NOT NULL — 결제 ID
- amount — INT — NOT NULL — 실결제 금액
- credit_amount — INT — NOT NULL — 크레딧 금액
- payment_state — ENUM('PENDING','PAID','FAILED','REFUNDED') — NOT NULL — 결제 상태
- payment_method — VARCHAR(30) — NOT NULL — 결제 방법
- created_at — DATETIME — NOT NULL — 생성일
- updated_at — DATETIME — NOT NULL — 수정일
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL — 유저 ID
user_favorite_artist
- favorite_id — BIGINT — Primary key — NOT NULL — ID
- created_at — DATETIME — NOT NULL — 생성일
- user_id (user_id2) — BIGINT — Foreign key → users.user_id — NOT NULL — 유저 ID
- artist_id (artist_id2) — BIGINT — Foreign key → artist.artist_id — NOT NULL — 아티스트 ID
users
- user_id — BIGINT — Primary key — NOT NULL — 유저 ID
- email — VARCHAR(255) — NOT NULL — 이메일 / UNIQUE
- password — VARCHAR(255) — NOT NULL — 비밀번호
- nickname — VARCHAR(50) — NOT NULL — 닉네임
- profile_image_url — TEXT — 프로필 이미지 링크
- created_at — DATETIME — NOT NULL — 가입일
- updated_at — DATETIME — NOT NULL — 수정일
vote
- vote_id — BIGINT — Primary key — NOT NULL
- credit_amount — INT — NOT NULL — 크레딧 금액
- created_at — DATETIME — NOT NULL — 생성일
- artist_id (artist_id2) — BIGINT — Foreign key → artist.artist_id — NOT NULL — 아티스트 ID
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL — 유저 ID
- chart_id — BIGINT — Foreign key → chart.chart_id — NOT NULL — 차트 ID