gym_booking

Tables (14)

emd_regions

  • id — BIGINT — Primary key — NOT NULL
  • sigungu_id — BIGINT — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • id (id2) — BIGINT — Foreign key → sigungu_regions.id — NOT NULL

exercise_types

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

gym_class_trainers

  • class_id — BIGINT — Primary key — NOT NULL
  • trainer_id — BIGINT — Primary key — NOT NULL
  • id (id2) — BIGINT — Foreign key → gym_classes.id — NOT NULL
  • id (id3) — BIGINT — Foreign key → trainers.id — NOT NULL

gym_classes

  • id — BIGINT — Primary key — NOT NULL
  • gym_id — BIGINT — NOT NULL
  • exercise_type_id — BIGINT — NOT NULL
  • start_time — DATETIME — NOT NULL
  • end_time — DATETIME — NOT NULL
  • capacity — INT — NOT NULL
  • id (id2) — BIGINT — Foreign key → exercise_types.id — NOT NULL
  • id (id3) — BIGINT — Foreign key → gyms.id — NOT NULL

gym_exercise_types

  • gym_id — BIGINT — Primary key — NOT NULL
  • exercise_type_id — BIGINT — Primary key — NOT NULL
  • id (id2) — BIGINT — Foreign key → exercise_types.id — NOT NULL
  • id (id3) — BIGINT — Foreign key → gyms.id — NOT NULL

gyms

  • id — BIGINT — Primary key — NOT NULL
  • detail_region_id — BIGINT — NOT NULL
  • name — VARCHAR(255) — NOT NULL
  • address — VARCHAR(255) — NOT NULL
  • latitude — DECIMAL(10,7)
  • longitude — DECIMAL(10,7)
  • opening_time — TIME
  • closing_time — TIME
  • rating — DECIMAL(2,1)
  • id (id2) — BIGINT — Foreign key → emd_regions.id — NOT NULL

memberships

  • id — BIGINT — Primary key — NOT NULL
  • gym_id — BIGINT — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • period_days — INT — NOT NULL
  • price — INT — NOT NULL
  • is_active — TINYINT(1) — NOT NULL
  • id (id2) — BIGINT — Foreign key → gyms.id — NOT NULL

reservations

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — NOT NULL
  • class_id — BIGINT — NOT NULL
  • status — ENUM('PENDING', 'CONFIRMED', 'CANCELLED') — NOT NULL
  • reserved_at — DATETIME — NOT NULL
  • id (id2) — BIGINT — Foreign key → users.id — NOT NULL
  • id (id3) — BIGINT — Foreign key → gym_classes.id — NOT NULL

sido_regions

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

sigungu_regions

  • id — BIGINT — Primary key — NOT NULL
  • sido_id — BIGINT — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • id (id2) — BIGINT — Foreign key → sido_regions.id — NOT NULL

trainer_exercise_types

  • trainer_id — BIGINT — Primary key — NOT NULL
  • exercise_type_id — BIGINT — Primary key — NOT NULL
  • id (id2) — BIGINT — Foreign key → exercise_types.id — NOT NULL
  • id (id3) — BIGINT — Foreign key → trainers.id — NOT NULL

trainers

  • id — BIGINT — Primary key — NOT NULL
  • gym_id — BIGINT — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • gender — ENUM('MALE', 'FEMALE') — NOT NULL
  • career_years — INT
  • id (id2) — BIGINT — Foreign key → gyms.id — NOT NULL

user_memberships

  • id — BIGINT — Primary key — NOT NULL
  • started_at — DATETIME
  • ended_at — DATETIME
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • membership_id — BIGINT — Foreign key → memberships.id — NOT NULL

users

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • phone — VARCHAR(50) — NOT NULL
  • email — VARCHAR(255) — NOT NULL
  • gender — ENUM('MALE', 'FEMALE') — NOT NULL
  • password — VARCHAR(255) — NOT NULL