예매

테이블 (8)

booking_details

  • booking_detail_id — INT
  • booking_id — INT — NOT NULL
  • seat_id — INT — NOT NULL

bookings

  • booking_id — INT
  • performance_id — INT — NOT NULL
  • booking_date — TIMESTAMP
  • total_amount — DECIMAL(10, 2) — NOT NULL
  • status — ENUM('pending', 'confirmed', 'cancelled')

coupons

  • coupon_id — INT
  • code — VARCHAR(20) — NOT NULL
  • discount_type — ENUM('percentage', 'fixed') — NOT NULL
  • discount_value — DECIMAL(10, 2) — NOT NULL
  • valid_from — DATE — NOT NULL
  • valid_to — DATE — NOT NULL
  • usage_limit — INT
  • is_active — BOOLEAN

payments

  • payment_id — INT
  • booking_id — INT — NOT NULL
  • amount — DECIMAL(10, 2) — NOT NULL
  • payment_method — VARCHAR(50) — NOT NULL
  • toss_payment_key — VARCHAR(100)
  • status — ENUM('pending', 'completed', 'failed', 'refunded')
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

performances

  • performance_id — INT
  • title — VARCHAR(100) — NOT NULL
  • description — TEXT
  • date_time — DATETIME — NOT NULL
  • venue — VARCHAR(100) — NOT NULL
  • total_seats — INT — NOT NULL
  • price — DECIMAL(10, 2) — NOT NULL

seats

  • seat_id — INT
  • performance_id — INT — NOT NULL
  • seat_number — VARCHAR(10) — NOT NULL
  • status — ENUM('available', 'reserved', 'sold')

user_coupons

  • user_coupon_id — INT
  • user_id — INT — NOT NULL
  • coupon_id — INT — NOT NULL
  • is_used — BOOLEAN
  • used_at — TIMESTAMP

users

  • user_id — INT
  • username — VARCHAR(50) — NOT NULL
  • email — VARCHAR(100) — NOT NULL
  • password — VARCHAR(255) — NOT NULL
  • created_at — TIMESTAMP