Hotel

Tables (10)

holidays

  • holiday_id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • date — DATE — NOT NULL
  • created_at — DATETIME — NOT NULL

hotels

  • hotel_id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(100) — NOT NULL

points

  • point_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • reservation_id — BIGINT — Foreign key → reservations.reservation_id
  • review_id — BIGINT — Foreign key → reviews.review_id
  • points — INT — NOT NULL
  • expiry_date — DATE — NOT NULL
  • status — TINYINT — NOT NULL
  • created_at — DATETIME — NOT NULL

reservations

  • reservation_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • room_id — BIGINT — Foreign key → rooms.room_id — NOT NULL
  • reservation_code — VARCHAR(20) — NOT NULL
  • check_in_date — DATE — NOT NULL
  • check_out_date — DATE — NOT NULL
  • guest_count — TINYINT — NOT NULL
  • status — TINYINT — NOT NULL
  • total_price — DECIMAL(10, 2) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

review_images

  • image_id — BIGINT — Primary key — NOT NULL
  • review_id — BIGINT — Foreign key → reviews.review_id — NOT NULL
  • image_url — VARCHAR(255) — NOT NULL
  • image_order — INT — NOT NULL
  • created_at — DATETIME — NOT NULL

reviews

  • review_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • reservation_id — BIGINT — Foreign key → reservations.reservation_id — NOT NULL
  • room_id — BIGINT — Foreign key → rooms.room_id — NOT NULL
  • rating — TINYINT — NOT NULL
  • content — TEXT — NOT NULL
  • is_visible — TINYINT(1) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

room_images

  • image_id — BIGINT — Primary key — NOT NULL
  • room_id — BIGINT — Foreign key → rooms.room_id — NOT NULL
  • image_url — VARCHAR(255) — NOT NULL
  • image_order — INT — NOT NULL
  • created_at — DATETIME — NOT NULL

room_pricing

  • pricing_id — BIGINT — Primary key — NOT NULL
  • room_id — BIGINT — Foreign key → rooms.room_id — NOT NULL
  • peak_price — DECIMAL(10, 2) — NOT NULL
  • off_peak_price — DECIMAL(10, 2) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

rooms

  • room_id — BIGINT — Primary key — NOT NULL
  • hotel_id — BIGINT — Foreign key → hotels.hotel_id — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • capacity — TINYINT — NOT NULL
  • floor — TINYINT — NOT NULL
  • bathtub_flag — TINYINT(1) — NOT NULL
  • view_type — TINYINT — NOT NULL
  • created_at — DATETIME — NOT NULL

users

  • user_id — BIGINT — Primary key — NOT NULL
  • username — VARCHAR(50) — NOT NULL
  • password — VARCHAR(100) — NOT NULL
  • email — VARCHAR(100) — NOT NULL
  • phone — VARCHAR(20)
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL