fitness_project
Tables (11)
Users (유저)
- id — BIGINT — Primary key — NOT NULL
- 이메일 (email) — VarChar(100) — NOT NULL
- 비밀번호 (password) — VarChar(50) — NOT NULL
- 이름 (name) — VarChar(30) — NOT NULL
- 폰번호 (phone_number) — VarChar(15) — NOT NULL
- 성별 (gender) — Enum — NOT NULL
- 역할 (role) — Enum — NOT NULL — 회원,트레이너,오너,관리자
- 상태 (status) — active(정상사용),suspended(정지),deleted(탈퇴,삭제)
- 만들어진 시간 (created_at) — DateTime — NOT NULL
gym_members (회원의 피트니스 소속)
- id — BIGINT — Primary key — NOT NULL
- 상태 (status) — Enum — NOT NULL — active(현재해당피트니스 소속회원),inactive(탈퇴/해지/차단)
- 가입날짜 (joined_at) — DateTime — NOT NULL
- 유저id (member_id) — Foreign key → Users.id — NOT NULL
- 헬스장id (gym_id) — Foreign key → gyms.id — NOT NULL
- 탈퇴시간 (left_at) — DateTime
gym_members (헬스장 회원소속)
- id (Key) — BIGINT — Primary key — NOT NULL
- 헬스장 id (gym_id) — BIGINT — Foreign key → gyms.id — NOT NULL
- 유저id (member_id) — BIGINT — Foreign key → Users.id — NOT NULL
- 상태 (status) — Enum — NOT NULL — active/inactive
- 가입날짜 (joined_at) — DateTime — NOT NULL
- 탈퇴날짜 (left_at) — DateTime
- 생성날짜 (created_at) — DateTime — NOT NULL
- 수정날짜 (updated_at) — DateTime — NOT NULL
gym_registration_applications (헬스장 등록)
- id — BIGINT — Primary key — NOT NULL
- applicant_owner_id — BIGINT — Foreign key → Users.id — NOT NULL
- 헬스장 이름 (gym_name) — VarChar(100) — NOT NULL
- 주소 (address) — VarChar(255) — NOT NULL
- business_reg_no — VarChar(20) — NOT NULL — 사업자 번호
- business_license_file_url — VarChar(500) — NOT NULL
- 사업주 이름 (owner_name) — Varchar(50) — NOT NULL
- 사업주 번호 (owner_phone) — VarChar(20) — NOT NULL
- 등록 상태 (status) — Enum — NOT NULL — pending/approved/rejected
- 반려사유 (review_note) — Text
- 생성일자 (created_at) — DateTime — NOT NULL
- 수정 일자 (updated_at) — DateTime — NOT NULL
- reviewed_by_admin_id — BIGINT — Foreign key → Users.id — NOT NULL
gyms (피트니스 센터)
- id — BIGINT — Primary key — NOT NULL
- 헬스장 명 (name) — VarChar(50) — NOT NULL
- 주소 (address) — VarChar(255) — NOT NULL
- owner_id (Field2)
- 상태 (status) — Enum — NOT NULL — 헬스장 등록 상태
- id (Key) — Foreign key → Users.id — NOT NULL
pt_log_items (기록)
- Key — Primary key — NOT NULL
- pt_log_id — Foreign key → pt_logs.Key — NOT NULL
- 세트수 (set_no) — Int — NOT NULL
- 무게 (weight) — Decimal(6,2) — 맨몸이면 null이용
- 랩스 (reps) — Int — NOT NULL
- 메모 (memo) — Text
- 정렬 (order_no) — Int — NOT NULL — 정렬
pt_logs (pt일지 /세트기록/자세영상/댓글(질문 -답변))
- Key — Primary key — NOT NULL
- pt_session_id — Foreign key → pt_sessions.Key — NOT NULL
- trainer_id — BIGINT — Foreign key → Users.id — NOT NULL
- member_id — BIGINT — Foreign key → Users.id — NOT NULL
- 제목 (title) — VarChar(100)
- 내용 (content) — Text — NOT NULL — 트레이너 코멘트
- 생성날짜 (created_at) — DateTime — NOT NULL
- 수정날짜 (updated_at) — DateTime — NOT NULL
pt_relationships (pt관계)
- Key — Primary key — NOT NULL
- 회원id (member_id) — BIGINT — Foreign key → Users.id — NOT NULL
- 트레이너id (trainer_id) — BIGINT — Foreign key → Users.id — NOT NULL
- 헬스장id (gym_id) — BIGINT — Foreign key → gyms.id
- 상태 (status) — Enum — NOT NULL
- 요청날짜 (requested_at) — DateTime — NOT NULL
- 결정날짜 (decided_at) — DateTime
- 생성날짜 (created_at) — DateTime — NOT NULL
- 수정날짜 (updated_at) — DateTime — NOT NULL
pt_sessions (pt예약)
- Key — Primary key — NOT NULL
- pt_relationship_id — Foreign key → pt_relationships.Key — NOT NULL
- 시작날짜 (start_at) — DateTime — NOT NULL
- 종료날짜 (end_at) — DateTime — NOT NULL
- 상태 (status) — Enum — NOT NULL — REQUESTED/APPROVED/REJECTED/CANCELLED/COMPLETED
- requested_by_user_id — BIGINT — Foreign key → Users.id — NOT NULL
- cancelled_by_user_id — BIGINT — Foreign key → Users.id — NOT NULL
- 취소사유 (cancel_reason) — Text
- 생성날짜 (created_at) — DateTime — NOT NULL
- 수정날짜 (updated_at) — DateTime — NOT NULL
pt_videos (피티 비디오 올리기)
- id — Primary key — NOT NULL
- pt_session_id — BigInt — Foreign key → pt_sessions.Key
- pt_relationship_id — BigInt — Foreign key → pt_relationships.Key — NOT NULL
- 트레이너id (trainer_id) — BigInt — NOT NULL
- Field
trainer_gym_memberships (승인된 트레이너 소속)
- Key — Primary key — NOT NULL
- 트레이너id (trainer_id) — BIGINT — Foreign key → Users.id — NOT NULL
- 헬스장id (gym_id) — BIGINT — Foreign key → gyms.id — NOT NULL
- 상태 (status) — Enum — NOT NULL — active/inactive
- 가입날짜 (joined_at) — DateTime — NOT NULL
- 탈퇴날짜 (left_at) — DateTime
- 생성날짜 (created_at) — DateTime — NOT NULL
- 수정날짜 (updated_at) — DateTime — NOT NULL