2

Tables (8)

Artists

  • artist_id — INT
  • name — VARCHAR(100) — NOT NULL
  • debut_date — DATE
  • agency — VARCHAR(100)
  • profile_image_url — VARCHAR(500)
  • description — TEXT
  • created_at — TIMESTAMP
  • INDEX — idx_name

Credit_Transactions

  • transaction_id — INT
  • user_id — INT — NOT NULL
  • transaction_type — ENUM('charge', 'spend', 'refund') — NOT NULL
  • amount — DECIMAL(10,2) — NOT NULL
  • balance_after — DECIMAL(10,2) — NOT NULL
  • description — VARCHAR(255)
  • reference_type — ENUM('sponsorship', 'vote', 'charge', 'refund')
  • reference_id — INT
  • created_at — TIMESTAMP
  • INDEX — idx_user_id
  • INDEX — idx_transaction_type
  • INDEX — idx_created_at

Donations

  • donation_id — INT
  • artist_id — INT — NOT NULL
  • title — VARCHAR(200) — NOT NULL
  • description — TEXT
  • target_credits — DECIMAL(12,2) — NOT NULL
  • current_credits — DECIMAL(12,2)
  • deadline — DATETIME — NOT NULL
  • status — ENUM('active', 'completed', 'expired', 'cancelled')
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP
  • INDEX — idx_artist_id
  • INDEX — idx_status
  • INDEX — idx_deadline

Follows

  • follow_id — INT
  • user_id — INT — NOT NULL
  • artist_id — INT — NOT NULL
  • created_at — TIMESTAMP
  • INDEX — idx_user_id
  • INDEX — idx_artist_id

Sponsorships

  • sponsorship_id — INT
  • user_id — INT — NOT NULL
  • donation_id — INT — NOT NULL
  • credit_amount — DECIMAL(10,2) — NOT NULL
  • created_at — TIMESTAMP
  • INDEX — idx_user_id
  • INDEX — idx_donation_id
  • INDEX — idx_created_at

Users

  • user_id — INT
  • username — VARCHAR(50) — NOT NULL
  • email — VARCHAR(100) — NOT NULL
  • password_hash — VARCHAR(255) — NOT NULL
  • current_credits — DECIMAL(10,2)
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP
  • INDEX — idx_username
  • INDEX — idx_email

Vote_Categories

  • category_id — INT
  • category_name — VARCHAR(50) — NOT NULL
  • description — TEXT
  • is_active — BOOLEAN
  • created_at — TIMESTAMP

Votes

  • vote_id — INT
  • user_id — INT — NOT NULL
  • artist_id — INT — NOT NULL
  • category_id — INT — NOT NULL
  • credit_cost — DECIMAL(8,2) — NOT NULL
  • created_at — TIMESTAMP
  • INDEX — idx_user_id
  • INDEX — idx_artist_id
  • INDEX — idx_category_id
  • INDEX — idx_created_at