bang-bang-erd

Tables (6)

Discount (discounts)

  • id — BIGINT(11) — Primary key — NOT NULL
  • houseId (house_id) — BIGINT(11) — Foreign key → House.id — NOT NULL
  • type — ENUM('weekly,', 'monthly', 'seasonal')
  • percentOff (percent_off) — DECIMAL(5,2)
  • amountOff (amount_off) — INT
  • startDate (start_date) — DATE
  • endDate (end_date) — DATE
  • Field

House (houses)

  • id — BIGINT(11) — Primary key — NOT NULL
  • name — VARCHAR(255)
  • type — ENUM('APARTMENT', 'HOTEL', 'MANSION')
  • address — VARCHAR(255)
  • thumbnail — VARCHAR(255)
  • rate — FLOAT
  • reviewCount (review_count) — INT
  • pricePerNight (price_per_night) — INT
  • latitude — DECIMAL
  • longitude — DECIMAL
  • capacity — TINYINT
  • bedroom — TINYINT
  • bed — TINYINT
  • restroom — TINYINT
  • cleaningFee (cleaning_fee) — INT

HouseOptions (house_options)

  • houseId (house_id) — BIGINT(11) — Foreign key → House.id — NOT NULL
  • optionId (option_id) — BIGINT(11) — Foreign key → Option.id — NOT NULL

Option (options)

  • id — BIGINT(11) — Primary key — NOT NULL
  • name — VARCHAR(32)
  • createdAt (created_at) — DATETIME
  • updatedAt (updated_at) — DATETIME

Reservation (reservations)

  • id — BIGINT(11) — Primary key — NOT NULL
  • houseId (house_id) — BIGINT(11) — Foreign key → House.id — NOT NULL
  • checkInDate (check_in_date) — DATETIME
  • chcekOutDate (chcek_out_date) — DATETIME
  • headcount — TINYINT
  • phoneNumber (phone_number) — VARCHAR(20)
  • createdAt (created_at) — DATETIME
  • updatedAt (updated_at) — DATETIME

ReservationSnapshot (reservationSnapshots)

  • id — BIGINT(11) — Primary key — NOT NULL
  • reservationId (reservation_id) — BIGINT(11) — Foreign key → Reservation.id — NOT NULL
  • nights — INT
  • nightSubtotal (night_subtotal) — INT
  • discountTotal (discount_total) — INT
  • cleaningFee (cleaning_fee) — INT
  • serviceFee (service_fee) — INT
  • taxTotal (tax_total) — INT
  • grandTotal (grand_total) — INT
  • createdAt (created_at) — DATETIME
  • updatedAt (updated_at) — DATETIME