asd

Tables (35)

amenity

  • id — BIGINT — Primary key — NOT NULL
  • icon — VARCHAR(100)
  • name — VARCHAR(50) — NOT NULL
  • type — ENUM('PLACE', 'ROOM')

coupon

  • id — BIGINT — Primary key — NOT NULL
  • amount — INT — NOT NULL
  • coupon_code — VARCHAR(100) — NOT NULL
  • coupon_name — VARCHAR(100) — NOT NULL
  • coupon_type — ENUM('fixed', 'rate') — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • expired_at — DATETIME(6) — NOT NULL
  • max_order_amount — INT
  • min_order_amount — INT
  • place_id — BIGINT — Foreign key → places.id

coupon_history

  • id — BIGINT — Primary key — NOT NULL
  • discount_amount — INT — NOT NULL
  • status — ENUM('canceled', 'pending', 'refunded', 'used') — NOT NULL
  • used_at — DATETIME(6) — NOT NULL
  • reservation_reservation_id — BIGINT — Foreign key → reservations.reservation_id
  • user_coupon_id — BIGINT — Foreign key → user_coupon.id

daily_place_reservation

  • id — BIGINT — Primary key — NOT NULL
  • available_room — INT — NOT NULL
  • date — DATE — NOT NULL
  • room_id — BIGINT — Foreign key → room.id — NOT NULL

discount

  • id — BIGINT — Primary key — NOT NULL
  • discount_value — INT
  • end_date — DATE
  • name — VARCHAR(255)
  • start_date — DATE
  • place_id — BIGINT — Foreign key → places.id
  • max_discount_amount — INT

file

  • id — BIGINT — Primary key — NOT NULL
  • domain — VARCHAR(20) — NOT NULL
  • domain_file_id — BIGINT — NOT NULL
  • extension — VARCHAR(50) — NOT NULL
  • filename — VARCHAR(100) — NOT NULL
  • filetype — VARCHAR(10) — NOT NULL
  • url — MEDIUMTEXT — NOT NULL
  • user_id — BIGINT — NOT NULL

guest

  • id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(255)
  • first_name — VARCHAR(255)
  • last_name — VARCHAR(255)
  • phone — VARCHAR(255)
  • users_id — BIGINT — Foreign key → users.id

image_list

  • image_id — BIGINT — Primary key — NOT NULL
  • image_url — VARCHAR(255)
  • place_id — BIGINT — Foreign key → places.id

my_test

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(255)

notification

  • id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6)
  • content — VARCHAR(255)
  • notification_type — ENUM('AD', 'ADMIN', 'CHECKIN', 'CHECKOUT', 'COMMON', 'RESERVATION')
  • title — VARCHAR(255)
  • user_id — BIGINT — Foreign key → users.id

notification_read

  • id — BIGINT — Primary key — NOT NULL
  • read_at — DATETIME(6)
  • user_id — BIGINT — Foreign key → users.id

owner_request

  • id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6)
  • business_number — VARCHAR(255)
  • decision_at — DATETIME(6)
  • rejection_reason — VARCHAR(255)
  • status — ENUM('APPROVED', 'PENDING', 'REJECTED')
  • user_id — BIGINT — Foreign key → users.id

payment_history

  • id — BIGINT — Primary key — NOT NULL
  • payment_info — TEXT
  • payment_id — BIGINT — Foreign key → payments.id

payments

  • id — BIGINT — Primary key — NOT NULL
  • amount — BIGINT
  • method — ENUM('bank_transfer', 'card', 'coupon', 'points') — NOT NULL
  • method_type — VARCHAR(255)
  • order_id — VARCHAR(255)
  • payment_key — VARCHAR(255) — NOT NULL
  • status — ENUM('paid', 'cancelled', 'refunded')
  • transaction_date — DATETIME(6) — NOT NULL
  • reservation_id — BIGINT — Foreign key → reservations.reservation_id — NOT NULL

place_address

  • id — BIGINT — Primary key — NOT NULL
  • detail_address — VARCHAR(200)
  • lat — DECIMAL(10, 7)
  • lng — DECIMAL(10, 7)
  • postal_code — VARCHAR(5) — NOT NULL
  • road_name — VARCHAR(100) — NOT NULL
  • sido — VARCHAR(50) — NOT NULL
  • sigungu — VARCHAR(50) — NOT NULL
  • town — VARCHAR(50)
  • place_id — BIGINT — Foreign key → places.id — NOT NULL

place_amenities

  • place_id — BIGINT — Foreign key → places.id — NOT NULL
  • amenity_id — BIGINT — Foreign key → amenity.id — NOT NULL

place_amenity

  • id — BIGINT — Primary key — NOT NULL
  • amenity_id — BIGINT — Foreign key → amenity.id — NOT NULL
  • place_id — BIGINT — Foreign key → places.id — NOT NULL

place_category

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(255)

place_service

  • place_key — BIGINT — Primary key — NOT NULL
  • place_id — BIGINT — Foreign key → places.id
  • service_service_id — BIGINT — Foreign key → service.service_id

places

  • id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6)
  • avg_rating — DECIMAL(3, 2)
  • check_in — TIME(6)
  • check_out — TIME(6)
  • description — TEXT
  • is_public — BIT
  • min_price — DECIMAL(10, 2)
  • name — VARCHAR(100) — NOT NULL
  • review_count — INT
  • status — ENUM('APPROVED', 'INACTIVE', 'PENDING', 'REJECTED')
  • updated_at — DATETIME(6)
  • category_id — BIGINT — Foreign key → place_category.id
  • owner_id — BIGINT — Foreign key → users.id

point_history

  • id — BIGINT — Primary key — NOT NULL
  • amount — BIGINT — NOT NULL
  • balance_after — BIGINT — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • description — VARCHAR(255)
  • expire_at — DATE
  • type — ENUM('EARN', 'USE') — NOT NULL
  • reservation_reservation_id — BIGINT — Foreign key → reservations.reservation_id
  • user_id — BIGINT — Foreign key → users.id

questions

  • question_id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6)
  • answer — LONGTEXT
  • content — LONGTEXT
  • title — VARCHAR(200) — NOT NULL
  • place_id — BIGINT — Foreign key → places.id — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL

regions

  • id — BIGINT — Primary key — NOT NULL
  • dong — VARCHAR(50)
  • sido — VARCHAR(50) — NOT NULL
  • sigungu — VARCHAR(50) — NOT NULL

reservations

  • reservation_id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6)
  • amount — DECIMAL(38, 2) — NOT NULL
  • coupon_discount_amount — INT
  • final_amount — DECIMAL(38, 2) — NOT NULL
  • fixed_discount_amount — INT
  • order_id — VARCHAR(255)
  • payment_status — ENUM('unpaid', 'paid', 'refunded', 'rejected', 'cancelled')
  • point_discount_amount — INT
  • request — VARCHAR(255)
  • resev_amount — BIGINT
  • resev_end — DATE
  • resev_start — DATE
  • status — ENUM('pending', 'confirmed', 'cancelled', 'checked_in', 'checked_out')
  • user_id — BIGINT — Foreign key → guest.id
  • room_id — BIGINT — Foreign key → room.id

review_comments

  • id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6)
  • comment — TINYTEXT — NOT NULL
  • review_id — BIGINT — Foreign key → reviews.review_id — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL

review_images

  • id — BIGINT — Primary key — NOT NULL
  • image_url — VARCHAR(512) — NOT NULL
  • review_id — BIGINT — Foreign key → reviews.review_id — NOT NULL

reviews

  • review_id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6)
  • comment — LONGTEXT
  • rating — INT — NOT NULL
  • place_id — BIGINT — Foreign key → places.id — NOT NULL
  • reservation_id — BIGINT — Foreign key → reservations.reservation_id — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL

room

  • id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6)
  • area — DOUBLE
  • bed_type — VARCHAR(50) — NOT NULL
  • capacity_people — INT — NOT NULL
  • capacity_room — INT — NOT NULL
  • price — DECIMAL(10, 2) — NOT NULL
  • room_type — VARCHAR(50) — NOT NULL
  • status — ENUM('AVAILABLE', 'CLEANING', 'RESERVED') — NOT NULL
  • place_id — BIGINT — Foreign key → places.id

room_amenity_entity

  • id — BIGINT — Primary key — NOT NULL
  • amenity_id — BIGINT — Foreign key → amenity.id
  • room_id — BIGINT — Foreign key → room.id

room_no

  • id — BIGINT — Primary key — NOT NULL
  • room_id — BIGINT — Foreign key → room.id — NOT NULL
  • room_no — VARCHAR(255) — NOT NULL

service

  • service_id — BIGINT — Primary key — NOT NULL
  • service_icon — VARCHAR(255)
  • service_name — VARCHAR(255)

shopping

  • id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6)
  • check_out — DATE
  • quantity — INT
  • check_in — DATE
  • room_id — BIGINT — Foreign key → room.id — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL

user_coupon

  • id — BIGINT — Primary key — NOT NULL
  • is_used — BIT — NOT NULL
  • issued_at — DATETIME(6) — NOT NULL
  • coupon_id — BIGINT — Foreign key → coupon.id
  • user_id — BIGINT — Foreign key → users.id

users

  • id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6)
  • email — VARCHAR(100)
  • name — VARCHAR(50) — NOT NULL
  • password — VARCHAR(255)
  • phone — VARCHAR(20)
  • point — BIGINT
  • role — ENUM('customer', 'hotel_owner', 'admin', 'place_admin', 'user_admin') — NOT NULL
  • status — ENUM('active', 'inactive', 'banned')
  • updated_at — DATETIME(6) — NOT NULL
  • user_id — VARCHAR(255) — NOT NULL

wishlist

  • id — BIGINT — Primary key — NOT NULL
  • created_at — DATETIME(6)
  • place_id — BIGINT — Foreign key → places.id — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL