Fandom-K

Tables (9)

Artist

  • artist_id — INT — Primary key — NOT NULL
  • name — VARCHAR(50)

project

  • project_id — INT — Primary key — NOT NULL
  • title — VARCHAR(255) — NOT NULL
  • goal_credit — INT — NOT NULL
  • current_credit — INT — NOT NULL
  • status — ENUM('planned','open','success','fail') — NOT NULL
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL
  • artist_id — INT — Foreign key → Artist.artist_id — NOT NULL

project_donation

  • donation_id — INT — Primary key — NOT NULL
  • amount_credit — INT — NOT NULL
  • user_id — INT — Foreign key → user.user_id — NOT NULL
  • project_id — INT — Foreign key → project.project_id — NOT NULL

user

  • user_id — INT — Primary key — NOT NULL
  • email — VARCHAR(50) — NOT NULL
  • password_hash — VARCHAR(55) — NOT NULL
  • nickname — VARCHAR(25) — NOT NULL
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL

user_credit_history

  • history_id — INT — NOT NULL
  • type — ENUM('charge','consume','reward') — NOT NULL
  • amount — INT — NOT NULL
  • source_type — VARCHAR(50) — NOT NULL
  • source_id — INT
  • created_at — TIMESTAMP — NOT NULL
  • user_id — INT — Foreign key → user_credit_wallet.user_id — NOT NULL

user_credit_wallet

  • user_id — INT — Primary key — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL

user_vote_history

  • vote_id — INT — NOT NULL
  • entry_id — INT — NOT NULL
  • credit_used — INT — NOT NULL
  • created_at — TIMESTAMP — NOT NULL
  • user_id — INT — Foreign key → user.user_id — NOT NULL

vote_artist_entry

  • entry_id — INT — Primary key — NOT NULL
  • year_month — CHAR(7) — NOT NULL
  • artist_id — INT — Foreign key → Artist.artist_id — NOT NULL
  • category_id — INT — Foreign key → vote_category.category_id — NOT NULL

vote_category

  • category_id — INT — Primary key — NOT NULL
  • name — VARCHAR(30) — NOT NULL
  • credit_cost — INT — NOT NULL