table-booking

Tables (9)

business_hours

  • id — bigint — Primary key — NOT NULL
  • weekday — VARCHAR(20)
  • start_time — time
  • end_time — time
  • restrarant_id — bigint — Foreign key → restaurants.id — NOT NULL
  • created_at — datetime
  • modified_at — datetime

members

  • id — bigint — Primary key — NOT NULL
  • username — varchar(50)
  • password — text
  • type — VARCHAR(20)
  • name — varchar(50)
  • phone_number — varchar(50)
  • created_at — datetime
  • modified_at — datetime

menus

  • id — bigint — Primary key — NOT NULL
  • name — varchar(50)
  • restaurant_id — bigint — Foreign key → restaurants.id — NOT NULL
  • created_at — datetime
  • modified_at — datetime

photos

  • id — bigint — Primary key — NOT NULL
  • url — VARCHAR(2048)
  • created_at — datetime
  • modified_at — datetime
  • restaurant_id — bigint — Foreign key → restaurants.id — NOT NULL

reservation_schedules

  • id — bigint — Primary key — NOT NULL
  • weekday — VARCHAR(20)
  • start_time — time
  • end_time — time
  • created_at — datetime
  • modified_at — datetime
  • id (reservation_setting_id) — bigint — Foreign key → reservation_settings.id — NOT NULL

reservation_settings

  • id — bigint — Primary key — NOT NULL
  • activation — boolean
  • max_days — int
  • min_guest — int
  • max_guest — int
  • total_guest — int
  • restaurant_id — bigint — Foreign key → restaurants.id — NOT NULL
  • created_at — datetime
  • modified_at — datetime

reservations

  • id — bigint — Primary key — NOT NULL
  • reservation_date — timestamp
  • member_id — bigint — Foreign key → members.id — NOT NULL
  • reservation_schedule_id — bigint — Foreign key → reservation_schedules.id — NOT NULL
  • created_at — datetime
  • modified_at — datetime
  • reservation_setting_id — bigint — Foreign key → reservation_settings.id — NOT NULL
  • guest_count — int

restaurants

  • id — bigint — Primary key — NOT NULL
  • name — varchar(50)
  • category — VARCHAR(20)
  • price_range — VARCHAR(20)
  • content — text
  • location — varchar(200)
  • phone_number — varchar(50)
  • created_at — datetime
  • modified_at — datetime
  • member_id — bigint — Foreign key → members.id — NOT NULL

reviews

  • id — bigint — Primary key — NOT NULL
  • rating — VARCHAR(20)
  • content — text
  • created_at — datetime
  • modified_at — datetime
  • restaurant_id — bigint — Foreign key → restaurants.id — NOT NULL
  • reservation_id — bigint — Foreign key → reservations.id — NOT NULL
  • member_id — bigint — Foreign key → members.id — NOT NULL