test

Tables (9)

hotels

  • hotel_id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • address — VARCHAR(200) — NOT NULL
  • phone — VARCHAR(20) — NOT NULL
  • description — TEXT
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — 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
  • point_type — TINYINT — NOT NULL — 1:예약적립, 2:리뷰적립, 3:회수
  • point_amount — INT — NOT NULL
  • expiry_date — DATE
  • status — TINYINT — NOT NULL — 1:활성, 2:소멸, 3:사용됨
  • 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
  • number_of_guests — TINYINT — NOT NULL
  • status — TINYINT — NOT NULL — 1:예약완료, 2:취소
  • total_price — INT — 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(500) — NOT NULL
  • display_order — TINYINT — 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
  • rating — TINYINT — NOT NULL
  • content — TEXT — NOT NULL
  • visibility — TINYINT — NOT NULL — 1:노출, 0:비노출
  • 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(500) — NOT NULL
  • created_at — DATETIME — NOT NULL

room_prices

  • price_id — BIGINT — Primary key — NOT NULL
  • room_id — BIGINT — Foreign key → rooms.room_id — NOT NULL
  • season_type — TINYINT — NOT NULL — 1:비수기, 2:성수기
  • price — INT — 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 — 1:시티뷰, 2:바다뷰, 3:마운틴뷰
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

users

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