GYMFIT

Tables (23)

email_verification

  • email_verification_id — bigint(20) — Primary key — NOT NULL — 이메일 인증 고유 번호
  • email — varchar(255) — NOT NULL — 인증 대상 이메일
  • verification_code_hash — varchar(255) — NOT NULL — 암호화된 이메일 인증번호
  • purpose — enum('SIGNUP', 'PASSWORD_RESET') — NOT NULL — 인증 목적
  • is_verified — tinyint(1) — NOT NULL — 인증 완료 여부
  • attempt_count — int(11) — NOT NULL — 인증번호 확인 시도 횟수
  • expires_at — datetime — NOT NULL — 인증번호 만료 일시
  • verified_at — datetime — 인증 완료 일시
  • created_at — datetime — NOT NULL — 인증번호 생성 일시

exercise

  • exercise_id — bigint(20) — Primary key — NOT NULL — 운동 종목 고유 번호
  • exercise_code — varchar(50) — NOT NULL — 운동 종목 코드
  • exercise_name — varchar(100) — NOT NULL — 운동 종목명
  • category — varchar(30)
  • calories_per_minute — decimal(5, 2) — NOT NULL — 분당 예상 소모 칼로리
  • is_active — tinyint(1) — NOT NULL — 사용 여부
  • created_at — datetime — NOT NULL — 등록 일시
  • updated_at — datetime — NOT NULL — 수정 일시

gym

  • gym_id — bigint(20) — Primary key — NOT NULL
  • provider — varchar(20) — NOT NULL
  • external_place_id — varchar(100) — NOT NULL
  • gym_name — varchar(150) — NOT NULL
  • road_address — varchar(255) — NOT NULL
  • address — varchar(255)
  • phone — varchar(50)
  • place_url — varchar(500)
  • category_name — varchar(255)
  • latitude — decimal(10,7)
  • longitude — decimal(10,7)
  • is_active — tinyint(1) — NOT NULL
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

gym_machine

  • machine_id — bigint(20) — Primary key — NOT NULL
  • gym_id — bigint(20) — Foreign key → gym.gym_id — NOT NULL
  • machine_name — varchar(120) — NOT NULL
  • body_part — varchar(30) — NOT NULL
  • brand — varchar(100)
  • model_name — varchar(120)
  • description — text
  • usage_guide — text
  • caution — text
  • image_url — varchar(500)
  • image_storage_path — varchar(1000)
  • is_active — tinyint(1) — NOT NULL
  • created_by — bigint(20) — Foreign key → users.user_id
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

member_goal

  • member_goal_id — bigint(20) — Primary key — NOT NULL — 운동 목표 고유 번호
  • user_id — bigint(20) — Foreign key → users.user_id — NOT NULL — users 테이블의 회원 번호
  • goal_code — varchar(50) — NOT NULL — 운동 목표 코드
  • goal_name — varchar(100) — NOT NULL — 화면에 표시할 운동 목표명
  • created_at — datetime — NOT NULL — 운동 목표 등록 일시

member_profile

  • member_profile_id — bigint(20) — Primary key — NOT NULL — 일반 회원 프로필 고유 번호
  • user_id — bigint(20) — Foreign key → users.user_id — NOT NULL — users 테이블의 회원 번호
  • height_cm — decimal(5, 2) — 키(cm)
  • weight_kg — decimal(5, 2) — 몸무게(kg)
  • exercise_level — enum('BEGINNER', 'INTERMEDIATE', 'ADVANCED') — 운동 수준: 초급, 중급, 고급
  • weekly_workout_days — tinyint(3) — 주간 목표 운동 일수
  • created_at — datetime — NOT NULL — 프로필 생성 일시
  • updated_at — datetime — NOT NULL — 프로필 수정 일시

notification

  • notification_id — bigint(20) — Primary key — NOT NULL — 알림 고유 번호
  • user_id — bigint(20) — Foreign key → users.user_id — NOT NULL — 회원 번호
  • title — varchar(150) — NOT NULL — 알림 제목
  • message — text — NOT NULL — 알림 내용
  • notification_type — varchar(50)
  • target_url — varchar(500)
  • reference_id — bigint(20)
  • is_read — tinyint(1) — NOT NULL — 읽음 여부
  • created_at — datetime — NOT NULL — 알림 생성 일시

pt_assignment

  • assignment_id — bigint(20) — Primary key — NOT NULL
  • trainer_member_id — bigint(20) — Foreign key → trainer_member.trainer_member_id — NOT NULL
  • trainer_id — bigint(20) — Foreign key → users.user_id — NOT NULL
  • member_id — bigint(20) — Foreign key → users.user_id — NOT NULL
  • exercise_id — bigint(20) — Foreign key → exercise.exercise_id
  • user_exercise_id — bigint(20) — Foreign key → user_exercise.user_exercise_id
  • title — varchar(150) — NOT NULL
  • description — text
  • assigned_date — date — NOT NULL
  • due_date — date
  • target_sets — int(11)
  • target_reps — int(11)
  • target_minutes — int(11)
  • status — enum('ASSIGNED','IN_PROGRESS','COMPLETED','CANCELLED') — NOT NULL
  • completed_at — datetime
  • workout_record_id — bigint(20) — Foreign key → workout_record.workout_record_id
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

pt_feedback

  • feedback_id — bigint(20) — Primary key — NOT NULL
  • assignment_id — bigint(20) — Foreign key → pt_assignment.assignment_id — NOT NULL
  • workout_record_id — bigint(20) — Foreign key → workout_record.workout_record_id — NOT NULL
  • trainer_id — bigint(20) — Foreign key → users.user_id — NOT NULL
  • member_id — bigint(20) — Foreign key → users.user_id — NOT NULL
  • content — text — NOT NULL
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

pt_schedule

  • schedule_id — bigint(20) — Primary key — NOT NULL
  • trainer_member_id — bigint(20) — Foreign key → trainer_member.trainer_member_id — NOT NULL
  • trainer_id — bigint(20) — Foreign key → users.user_id — NOT NULL
  • member_id — bigint(20) — Foreign key → users.user_id — NOT NULL
  • start_at — datetime — NOT NULL
  • end_at — datetime — NOT NULL
  • location — varchar(200)
  • memo — text
  • status — enum('SCHEDULED','CANCELLED','COMPLETED') — NOT NULL
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

trainer_certification

  • trainer_certification_id — bigint(20) — Primary key — NOT NULL — 자격증 고유 번호
  • user_id — bigint(20) — Foreign key → users.user_id — NOT NULL — users 테이블의 트레이너 회원 번호
  • certification_name — varchar(150) — NOT NULL — 자격증 이름
  • certification_number — varchar(100)
  • issuer — varchar(150) — 자격증 발급 기관
  • acquired_date — date — 자격증 취득일
  • evidence_image_url — varchar(500)
  • evidence_storage_path — varchar(1000)
  • evidence_original_name — varchar(255)
  • is_active — tinyint(1) — NOT NULL
  • created_at — datetime — NOT NULL — 자격증 등록 일시

trainer_member

  • trainer_member_id — bigint(20) — Primary key — NOT NULL
  • trainer_id — bigint(20) — Foreign key → users.user_id — NOT NULL
  • member_id — bigint(20) — Foreign key → users.user_id — NOT NULL
  • status — enum('PENDING','ACTIVE','ENDED') — NOT NULL
  • started_at — date
  • ended_at — date
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

trainer_profile

  • trainer_profile_id — bigint(20) — Primary key — NOT NULL — 트레이너 프로필 고유 번호
  • user_id — bigint(20) — Foreign key → users.user_id — NOT NULL — users 테이블의 회원 번호
  • gym_name — varchar(150) — 소속 또는 근무 헬스장 이름
  • career_years — int(11) — 트레이너 경력 연수
  • introduction — varchar(300) — 트레이너 자기소개
  • approval_status — enum('PENDING', 'APPROVED', 'REJECTED') — NOT NULL — 트레이너 승인 상태
  • rejection_reason — varchar(500)
  • reviewed_by — bigint(20) — Foreign key → users.user_id
  • reviewed_at — datetime
  • employment_status — enum('NONE', 'PENDING', 'APPROVED', 'REJECTED') — NOT NULL
  • employment_evidence_url — varchar(500)
  • employment_storage_path — varchar(1000)
  • employment_original_name — varchar(255)
  • employment_reviewed_by — bigint(20) — Foreign key → users.user_id
  • employment_reviewed_at — datetime
  • employment_rejection_reason — varchar(500)
  • created_at — datetime — NOT NULL — 프로필 생성 일시
  • updated_at — datetime — NOT NULL — 프로필 수정 일시

trainer_specialty

  • trainer_specialty_id — bigint(20) — Primary key — NOT NULL — 전문 분야 고유 번호
  • user_id — bigint(20) — Foreign key → users.user_id — NOT NULL — users 테이블의 트레이너 회원 번호
  • specialty_code — varchar(50) — NOT NULL — 전문 분야 코드
  • specialty_name — varchar(100) — NOT NULL — 화면에 표시할 전문 분야명
  • created_at — datetime — NOT NULL — 전문 분야 등록 일시

user_agreement

  • user_id — bigint(20) — Foreign key → users.user_id — NOT NULL
  • terms_agreed — tinyint(1) — NOT NULL
  • privacy_agreed — tinyint(1) — NOT NULL
  • marketing_agreed — tinyint(1) — NOT NULL
  • trainer_policy_agreed — tinyint(1) — NOT NULL
  • agreed_at — datetime
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

user_exercise

  • user_exercise_id — bigint(20) — Primary key — NOT NULL
  • user_id — bigint(20) — Foreign key → users.user_id — NOT NULL
  • exercise_name — varchar(100) — NOT NULL
  • category — varchar(30)
  • is_active — tinyint(1) — NOT NULL
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

user_gym

  • user_gym_id — bigint(20) — Primary key — NOT NULL
  • user_id — bigint(20) — Foreign key → users.user_id — NOT NULL
  • gym_id — bigint(20) — Foreign key → gym.gym_id — NOT NULL
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

users

  • user_id — bigint(20) — Primary key — NOT NULL — 회원 고유 번호
  • account_type — enum('MEMBER', 'TRAINER', 'ADMIN') — NOT NULL — ??? ???
  • name — varchar(50) — NOT NULL — 회원 이름
  • email — varchar(255) — NOT NULL — 로그인 및 이메일 인증에 사용하는 이메일
  • login_provider — enum('LOCAL', 'GOOGLE') — NOT NULL — 로그인 제공자
  • google_sub — varchar(255) — Google 계정 고유 식별자
  • password_hash — varchar(255) — 암호화된 비밀번호, 소셜 로그인 계정은 NULL
  • gender — enum('MALE', 'FEMALE', 'NONE') — NOT NULL — 성별
  • birth_date — date — 생년월일
  • is_email_verified — tinyint(1) — NOT NULL — 이메일 인증 완료 여부
  • must_change_password — tinyint(1) — NOT NULL — 비밀번호 변경 필요 여부
  • temporary_password_expires_at — datetime — 임시 비밀번호 만료 일시
  • is_active — tinyint(1) — NOT NULL — 계정 활성화 여부
  • last_login_at — datetime — 마지막 로그인 일시
  • created_at — datetime — NOT NULL — 회원가입 일시
  • updated_at — datetime — NOT NULL — 회원 정보 수정 일시

workout_plan

  • workout_plan_id — bigint(20) — Primary key — NOT NULL — 운동 계획 고유 번호
  • user_id — bigint(20) — Foreign key → users.user_id — NOT NULL — 회원 번호
  • exercise_id — bigint(20) — Foreign key → exercise.exercise_id
  • user_exercise_id — bigint(20) — Foreign key → user_exercise.user_exercise_id
  • plan_date — date — NOT NULL — 운동 예정일
  • set_count — int(11) — NOT NULL — 계획 세트 수
  • repetition_count — int(11) — NOT NULL — 세트당 반복 횟수
  • estimated_minutes — int(11) — NOT NULL — 예상 운동 시간
  • is_completed — tinyint(1) — NOT NULL — 완료 여부
  • created_at — datetime — NOT NULL — 등록 일시
  • updated_at — datetime — NOT NULL — 수정 일시

workout_plan_set

  • workout_plan_set_id — bigint(20) — Primary key — NOT NULL
  • workout_plan_id — bigint(20) — Foreign key → workout_plan.workout_plan_id — NOT NULL
  • set_order — int(11) — NOT NULL
  • repetition_count — int(11)
  • duration_seconds — int(11)
  • weight_kg — decimal(7,2)
  • is_completed — tinyint(1) — NOT NULL
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

workout_record

  • workout_record_id — bigint(20) — Primary key — NOT NULL — 운동 기록 고유 번호
  • user_id — bigint(20) — Foreign key → users.user_id — NOT NULL — 회원 번호
  • record_type — enum('WORKOUT', 'PT') — NOT NULL
  • title — varchar(150)
  • workout_date — date
  • workout_part — varchar(100)
  • trainer_id — bigint(20) — Foreign key → users.user_id
  • pt_schedule_id — bigint(20) — Foreign key → pt_schedule.schedule_id
  • location — varchar(200)
  • memo — text
  • exercise_id — bigint(20) — Foreign key → exercise.exercise_id
  • user_exercise_id — bigint(20) — Foreign key → user_exercise.user_exercise_id
  • record_source — varchar(50) — NOT NULL
  • manual_note — text
  • started_at — datetime — NOT NULL — 운동 시작 일시
  • completed_at — datetime — 운동 완료 일시
  • completed_sets — int(11) — NOT NULL — 완료 세트 수
  • repetition_count — int(11) — NOT NULL — 전체 반복 횟수
  • workout_minutes — int(11) — NOT NULL — 운동 시간
  • calories — int(11) — NOT NULL — 소모 칼로리
  • average_posture_score — int(11)
  • best_posture_score — int(11)
  • feedback_title — varchar(150) — 자세 피드백 제목
  • feedback — text — 자세 피드백 내용
  • image_url — varchar(500) — 분석 이미지 URL
  • created_at — datetime — NOT NULL — 기록 생성 일시
  • updated_at — datetime — NOT NULL

workout_record_item

  • item_id — bigint(20) — Primary key — NOT NULL
  • record_id — bigint(20) — Foreign key → workout_record.workout_record_id — NOT NULL
  • exercise_id — bigint(20) — Foreign key → exercise.exercise_id
  • user_exercise_id — bigint(20) — Foreign key → user_exercise.user_exercise_id
  • exercise_name — varchar(100) — NOT NULL
  • weight_value — decimal(7,2)
  • weight_text — varchar(100)
  • repetitions — int(11)
  • completed_sets — int(11)
  • rpe — int(11)
  • workout_minutes — int(11)
  • memo — text
  • posture_score — int(11)
  • feedback — text
  • display_order — int(11) — NOT NULL
  • created_at — datetime — NOT NULL
  • updated_at — datetime — NOT NULL

workout_record_media

  • media_id — bigint(20) — Primary key — NOT NULL
  • item_id — bigint(20) — Foreign key → workout_record_item.item_id — NOT NULL
  • media_type — enum('VIDEO','IMAGE') — NOT NULL
  • media_url — varchar(500) — NOT NULL
  • thumbnail_url — varchar(500)
  • storage_path — varchar(1000) — NOT NULL
  • thumbnail_storage_path — varchar(1000)
  • duration_seconds — int(11)
  • file_size — bigint(20)
  • created_at — datetime — NOT NULL