MyErd

Tables (11)

Appointment (예약)

  • appointment_id (예약 ID) — PK — Primary key — NOT NULL
  • user_id (유저ID) — FK — Foreign key → User.user_id — NOT NULL
  • doctor_id (의사ID) — Foreign key → Doctor.doctor_id — NOT NULL
  • appointment_date (예약 일자)
  • status (상태)

ChatMessage (채팅 메시지)

  • chat_message (메시지ID) — PK — Primary key — NOT NULL
  • chat_session_id (채팅ID) — FK — Foreign key → ChatSession.chat_session_id — NOT NULL
  • user_id (유저ID) — FK — Foreign key → ChatSession.user_id — NOT NULL
  • message (메시지 내용)
  • send_at (메시지 보낸 시간)

ChatSession (채팅 세션)

  • chat_session_id (채팅ID) — PK — Primary key — NOT NULL
  • user_id (유저ID) — FK — Foreign key → User.user_id — NOT NULL
  • doctor_id (의사ID) — FK — Foreign key → Doctor.doctor_id — NOT NULL
  • started_at (채팅 시작 시간)
  • ended_at (채팅 종료 시간)

Clinic (병원)

  • clinic_id (병원ID) — Primary key — NOT NULL
  • name (이름)
  • address (주소)
  • latitude (위도)
  • longitude (경도)
  • phone (전화번호)
  • email (이메일)
  • created_at (병원 등록 일자)
  • updated_at (병원 업데이트 일자)

Comment (댓글)

  • comment_id (댓글ID) — PK — Primary key — NOT NULL
  • post_id (게시글ID) — FK — Foreign key → Post.post_id — NOT NULL
  • user_id (유저ID) — FK — Foreign key → Post.user_id — NOT NULL
  • content (댓글 내용)
  • created_at (댓글 작성 일자)
  • updated_at (댓글 업데이트 일자)

Doctor (의사)

  • doctor_id (의사ID) — PK — Primary key — NOT NULL
  • clinic_id (병원ID) — Foreign key → Clinic.clinic_id — NOT NULL
  • user_id (유저ID) — Foreign key → User.user_id — NOT NULL
  • specialty (전문분야)
  • phone (전화번호)

Post (게시글)

  • post_id (게시글ID) — PK — Primary key — NOT NULL
  • user_id (유저ID) — Foreign key → User.user_id — NOT NULL
  • title (게시글 제목)
  • content (게시글 내용)
  • created_at (게시글 작성 일자)
  • updated_at (게시글 업데이트 일자)

Recommendation (추천)

  • recommendation_id (추천ID) — PK — Primary key — NOT NULL
  • symptom_id (증상ID) — Foreign key → Symptom.symptom_id — NOT NULL
  • specialty (추천 진료과)
  • created_at (추천 생성 일자)

Review (리뷰)

  • review_id (리뷰ID) — PK — Primary key — NOT NULL
  • user_id (유저ID) — FK — Foreign key → User.user_id — NOT NULL
  • clinic_id (병원ID) — FK — Foreign key → Clinic.clinic_id — NOT NULL
  • rating (평점)
  • comment (리뷰 내용)
  • created_at (리뷰 작성 일자)
  • updated_at (리뷰 업데이트 일자)

Symptom (증상)

  • symptom_id (증상ID) — PK — Primary key — NOT NULL
  • user_id (유저ID) — Foreign key → User.user_id — NOT NULL
  • description (증상 설명)
  • created_ad (증상 입력 일자)

User (유저)

  • user_id (유저ID) — Primary key — NOT NULL
  • username (이름)
  • password (비밀번호)
  • email (이메일)
  • role (역할)
  • created_at (계정 생성 일자)
  • updated_at (계정 업데이트 일자)