1004

Tables (50)

activity_logs

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • family_member_id — uuid — Foreign key → family_members.id
  • date — date — NOT NULL
  • steps — int4 — NOT NULL — 걸음 수
  • exercise_minutes — int4 — NOT NULL — 운동 시간 (분)
  • calories_burned — int4 — NOT NULL — 소모 칼로리
  • activity_type — text — 운동 유형
  • source — text — NOT NULL — 데이터 출처
  • notes — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

allergies

  • id — uuid — Primary key — NOT NULL
  • code — varchar — NOT NULL — 알레르기 코드 (Unique)
  • name_ko — varchar — NOT NULL
  • name_en — varchar
  • category — varchar
  • severity_level — varchar — NOT NULL — 심각도 레벨: high, medium, low
  • description — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

allergy_derived_ingredients

  • id — uuid — Primary key — NOT NULL
  • allergy_code — varchar — Foreign key → allergies.code
  • ingredient_name — varchar — NOT NULL
  • ingredient_type — varchar
  • description — text
  • created_at — timestamp — NOT NULL

calorie_calculation_formulas

  • id — uuid — Primary key — NOT NULL
  • formula_name — varchar — NOT NULL
  • formula_type — varchar
  • gender — varchar — 성별: male, female, all
  • age_min — int4
  • age_max — int4
  • formula_expression — text — NOT NULL
  • description — text
  • user_id — uuid — Foreign key → users.id
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

character_levels

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • family_member_id — uuid — Foreign key → family_members.id — 가족 구성원 ID
  • level — int4 — NOT NULL
  • experience — int4 — NOT NULL
  • experience_to_next_level — int4 — NOT NULL — 다음 레벨까지 필요한 경험치
  • last_level_up_at — timestamp
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

character_skins

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • family_member_id — uuid — Foreign key → family_members.id
  • skin_id — text — NOT NULL — 스킨 식별자
  • unlocked_at — timestamp — NOT NULL
  • is_active — bool — NOT NULL — 현재 착용 중인 스킨 여부

community_groups

  • id — uuid — Primary key — NOT NULL
  • name — text — NOT NULL
  • description — text
  • category — text — NOT NULL — 그룹 카테고리: health, pet, recipe, exercise, region
  • cover_image_url — text
  • is_public — bool — NOT NULL — 공개 그룹 여부
  • is_family_only — bool — NOT NULL — 가족 내부 그룹 여부
  • owner_id — uuid — Foreign key → users.id — NOT NULL
  • member_count — int4 — NOT NULL — 그룹 멤버 수
  • post_count — int4 — NOT NULL — 그룹 게시글 수
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

daily_quests

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • quest_id — text — NOT NULL — 퀘스트 식별자
  • progress — int4 — NOT NULL — 현재 진행도
  • target — int4 — NOT NULL — 목표 달성 수치
  • completed — bool — NOT NULL
  • completed_at — timestamp
  • quest_date — date — NOT NULL
  • created_at — timestamp — NOT NULL

deworming_medications

  • id — uuid — Primary key — NOT NULL
  • medication_name — text — NOT NULL
  • active_ingredient — text — NOT NULL
  • standard_dosage — text — NOT NULL
  • standard_cycle_days — int4 — NOT NULL
  • target_parasites — text — NOT NULL — 대상 기생충 배열
  • age_group — text
  • contraindications — text — NOT NULL — 금기 사항 배열
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

diet_notification_settings

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • popup_enabled — bool — NOT NULL
  • browser_enabled — bool — NOT NULL
  • notification_time — time — NOT NULL
  • kcdc_enabled — bool — NOT NULL
  • last_notification_date — date
  • last_dismissed_date — date
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

diet_plans

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • family_member_id — uuid — Foreign key → family_members.id
  • plan_date — date — NOT NULL
  • meal_type — text — NOT NULL — 식사 타입: breakfast, lunch, dinner, snack
  • recipe_id — uuid — Foreign key → recipes.id
  • recipe_title — text — NOT NULL
  • recipe_description — text
  • ingredients — jsonb — NOT NULL
  • instructions — text
  • calories — int4
  • protein_g — numeric
  • carbs_g — numeric
  • fat_g — numeric
  • sodium_mg — int4
  • fiber_g — numeric
  • potassium_mg — int4
  • phosphorus_mg — int4
  • gi_index — numeric
  • composition_summary — jsonb — NOT NULL
  • is_unified — bool — NOT NULL
  • created_at — timestamp — NOT NULL
  • weekly_diet_plan_id — uuid — Foreign key → weekly_diet_plans.id — 주간 식단 계획 ID

disease_excluded_foods_extended

  • id — uuid — Primary key — NOT NULL
  • disease_code — varchar — Foreign key → diseases.code
  • food_name — varchar — NOT NULL
  • food_type — varchar
  • severity — varchar — NOT NULL — 심각도: high, medium, low
  • reason — text
  • exclusion_type — text — NOT NULL
  • created_at — timestamp — NOT NULL

disease_records

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • family_member_id — uuid — Foreign key → family_members.id
  • disease_name — text — NOT NULL
  • disease_code — text — Foreign key → diseases.code — 질병 코드 (diseases 테이블 참조)
  • diagnosis_date — date — NOT NULL
  • hospital_name — text
  • hospital_record_id — uuid — Foreign key → hospital_records.id — 진단받은 병원 기록 참조
  • status — text — NOT NULL — 질병 상태: active, cured, chronic, monitoring
  • severity — text — 심각도: mild, moderate, severe
  • treatment_plan — text
  • data_source_id — uuid — Foreign key
  • is_auto_synced — bool — NOT NULL
  • notes — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

diseases

  • id — uuid — Primary key — NOT NULL
  • code — varchar — NOT NULL — 질병 코드 (Unique)
  • name_ko — varchar — NOT NULL
  • name_en — varchar
  • category — varchar
  • description — text
  • calorie_adjustment_factor — numeric
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

emergency_procedures

  • id — uuid — Primary key — NOT NULL
  • allergy_code — varchar — Foreign key → allergies.code
  • procedure_type — varchar
  • title_ko — varchar — NOT NULL
  • title_en — varchar
  • steps — jsonb — NOT NULL
  • warning_signs — jsonb
  • when_to_call_911 — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

family_members

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • name — text — NOT NULL
  • birth_date — date — NOT NULL
  • gender — text — 성별: male, female, other
  • relationship — text — NOT NULL
  • diseases — text — NOT NULL
  • allergies — text — NOT NULL
  • height_cm — int4
  • weight_kg — numeric
  • activity_level — text — 활동 수준
  • dietary_preferences — text — NOT NULL
  • include_in_unified_diet — bool — NOT NULL — 통합 식단 포함 여부
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • vaccination_history — jsonb — NOT NULL — 과거 접종 이력
  • last_health_checkup_date — date — 마지막 건강검진 일자
  • member_type — text — NOT NULL — 구성원 유형: human(사람), pet(반려동물)
  • pet_type — text — 반려동물 종류: dog(강아지), cat(고양이), other(기타)
  • breed — text — 견종/묘종
  • lifecycle_stage — text — 생애주기 단계
  • pet_metadata — jsonb — NOT NULL — 반려동물 추가 정보
  • photo_url — text — 프로필 사진 URL
  • avatar_type — text — NOT NULL — 아바타 타입: photo(사진) 또는 icon(아이콘)
  • health_score — int4 — 최근 계산된 건강 점수 (0-100)
  • health_score_updated_at — timestamp — 건강 점수 계산 시각

favorite_meals

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • recipe_id — uuid — Foreign key → recipes.id
  • recipe_title — text — NOT NULL
  • meal_type — text — 식사 타입: breakfast, lunch, dinner, snack
  • calories — int4
  • protein — numeric
  • carbs — numeric
  • fat — numeric
  • notes — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

group_members

  • id — uuid — Primary key — NOT NULL
  • group_id — uuid — Foreign key → community_groups.id — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • role — text — NOT NULL — 멤버 역할: owner, moderator, member
  • joined_at — timestamp — NOT NULL

group_posts

  • id — uuid — Primary key — NOT NULL
  • group_id — uuid — Foreign key → community_groups.id — NOT NULL
  • author_id — uuid — Foreign key → users.id — NOT NULL
  • title — text — NOT NULL
  • content — text — NOT NULL
  • post_type — text — NOT NULL — 게시글 타입
  • images — jsonb — NOT NULL — 이미지 URL 배열
  • like_count — int4 — NOT NULL
  • comment_count — int4 — NOT NULL
  • view_count — int4 — NOT NULL
  • is_pinned — bool — NOT NULL — 고정글 여부
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

hospital_records

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • family_member_id — uuid — Foreign key → family_members.id
  • visit_date — date — NOT NULL
  • hospital_name — text — NOT NULL
  • hospital_code — text
  • department — text
  • diagnosis — text — NOT NULL — 진단명 배열
  • diagnosis_codes — text — NOT NULL — 진단 코드 배열
  • prescribed_medications — jsonb — NOT NULL — 처방약물 정보 배열
  • treatment_summary — text
  • data_source_id — uuid — Foreign key
  • is_auto_synced — bool — NOT NULL — 자동 동기화 여부
  • notes — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

medication_records

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • family_member_id — uuid — Foreign key → family_members.id
  • medication_name — text — NOT NULL
  • medication_code — text
  • active_ingredient — text
  • dosage — text — NOT NULL
  • frequency — text — NOT NULL
  • start_date — date — NOT NULL
  • end_date — date
  • reminder_times — time — NOT NULL — 복용 알림 시간 배열
  • reminder_enabled — bool — NOT NULL
  • hospital_record_id — uuid — Foreign key → hospital_records.id — 처방받은 병원 기록 참조
  • data_source_id — uuid — Foreign key
  • is_auto_synced — bool — NOT NULL — 자동 동기화 여부
  • notes — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

notifications

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id
  • family_member_id — uuid — Foreign key → family_members.id
  • type — text — NOT NULL — 알림 타입: system, health, vaccination, medication, periodic_service, lifecycle_event, pet_healthcare
  • category — text — 세부 카테고리
  • channel — text — 알림 채널: push, sms, email, in_app
  • title — text
  • message — text
  • status — text — NOT NULL — 상태: pending, sent, failed, dismissed, confirmed, missed, cancelled
  • priority — text — NOT NULL — 우선순위: low, normal, high, urgent
  • context_data — jsonb — NOT NULL
  • scheduled_at — timestamp
  • sent_at — timestamp
  • read_at — timestamp
  • confirmed_at — timestamp
  • related_id — uuid
  • related_type — text
  • recipient — text
  • error_message — text
  • retry_count — int4 — NOT NULL
  • is_test — bool — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

payment_transactions

  • id — uuid — Primary key — NOT NULL
  • subscription_id — uuid — Foreign key → subscriptions.id
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • status — text — NOT NULL — 상태: pending, completed, failed, refunded
  • transaction_type — text — NOT NULL — 거래 유형: subscription, one_time, refund
  • pg_provider — text — NOT NULL
  • pg_transaction_id — text
  • amount — int4 — NOT NULL
  • tax_amount — int4
  • net_amount — int4 — NOT NULL
  • payment_method — text
  • card_info — jsonb
  • paid_at — timestamp
  • refunded_at — timestamp
  • metadata — jsonb
  • is_test_mode — bool — NOT NULL
  • created_at — timestamp — NOT NULL

pet_vaccine_master

  • id — uuid — Primary key — NOT NULL
  • vaccine_name — text — NOT NULL
  • vaccine_code — text — NOT NULL
  • pet_type — text — NOT NULL — 대상 반려동물: dog, cat, both
  • lifecycle_stage — text — 권장 생애주기 단계
  • recommended_age_weeks — int4
  • recommended_age_months — int4
  • booster_interval_months — int4 — 추가 접종 주기
  • is_required — bool — NOT NULL
  • description — text
  • is_active — bool — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

post_comments

  • id — uuid — Primary key — NOT NULL
  • post_id — uuid — Foreign key → group_posts.id — NOT NULL
  • author_id — uuid — Foreign key → users.id — NOT NULL
  • content — text — NOT NULL
  • parent_comment_id — uuid — 대댓글인 경우 부모 댓글 ID
  • like_count — int4 — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

post_likes

  • id — uuid — Primary key — NOT NULL
  • post_id — uuid — Foreign key → group_posts.id — 게시글 ID
  • comment_id — uuid — Foreign key → post_comments.id — 댓글 ID
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • created_at — timestamp — NOT NULL

promo_code_uses

  • id — uuid — Primary key — NOT NULL
  • promo_code_id — uuid — Foreign key → promo_codes.id — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • subscription_id — uuid — Foreign key → subscriptions.id
  • used_at — timestamp — NOT NULL

promo_codes

  • id — uuid — Primary key — NOT NULL
  • code — text — NOT NULL
  • discount_type — text — NOT NULL — 할인 유형: percentage, fixed_amount, free_trial
  • discount_value — int4 — NOT NULL
  • max_uses — int4
  • current_uses — int4 — NOT NULL
  • valid_from — timestamp — NOT NULL
  • valid_until — timestamp — NOT NULL
  • applicable_plans — text
  • new_users_only — bool — NOT NULL
  • description — text
  • created_by — uuid — Foreign key → users.id
  • created_at — timestamp — NOT NULL

recipe_ingredients

  • id — uuid — Primary key — NOT NULL
  • recipe_id — uuid — Foreign key → recipes.id — NOT NULL
  • name — text — NOT NULL
  • ingredient_name — text
  • quantity — numeric
  • unit — text
  • notes — text
  • display_order — int4 — NOT NULL
  • category — ingredient_category — NOT NULL
  • is_optional — bool — NOT NULL
  • preparation_note — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

recipe_ratings

  • id — uuid — Primary key — NOT NULL
  • recipe_id — uuid — Foreign key → recipes.id — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • rating — numeric — NOT NULL — 별점 0~5점
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

recipe_reports

  • id — uuid — Primary key — NOT NULL
  • recipe_id — uuid — Foreign key → recipes.id — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • report_type — text — NOT NULL — 신고 유형: inappropriate, copyright, spam, other
  • reason — text — NOT NULL
  • status — text — NOT NULL — 상태: pending, reviewing, resolved, dismissed
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

recipe_steps

  • id — uuid — Primary key — NOT NULL
  • recipe_id — uuid — Foreign key → recipes.id — NOT NULL
  • step_number — int4 — NOT NULL
  • content — text — NOT NULL
  • image_url — text
  • video_url — text
  • timer_minutes — int4
  • created_at — timestamp — NOT NULL

recipe_usage_history

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • family_member_id — uuid — Foreign key → family_members.id
  • recipe_id — uuid — Foreign key → recipes.id — 레시피 ID
  • recipe_title — text — NOT NULL
  • recipe_url — text
  • meal_type — text — 식사 타입
  • used_date — date — NOT NULL
  • created_at — timestamp — NOT NULL

recipe_variation_groups

  • id — uuid — Primary key — NOT NULL
  • main_ingredient — text — NOT NULL — 메인 재료
  • base_recipe_id — uuid — Foreign key → recipes.id — 기본 레시피 ID
  • variation_type — text — NOT NULL — 변형 타입
  • description — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

recipes

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id
  • slug — text — NOT NULL — URL 친화적 식별자 (Unique)
  • title — text — NOT NULL
  • description — text
  • thumbnail_url — text
  • difficulty — int4 — NOT NULL — 난이도 (1~5점)
  • cooking_time_minutes — int4 — NOT NULL
  • servings — int4 — NOT NULL
  • calories — numeric
  • carbohydrates — numeric
  • protein — numeric
  • fat — numeric
  • sodium — numeric
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • main_ingredients — text — NOT NULL — 메인 재료 목록
  • cooking_method — text — 조리법
  • variation_group_id — uuid — Foreign key → recipe_variation_groups.id — 변형 그룹 ID
  • nutrition_focus — text — NOT NULL — 영양소 강점
  • age_group_suitable — text — NOT NULL — 적합 연령대

sleep_logs

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • family_member_id — uuid — Foreign key → family_members.id
  • date — date — NOT NULL
  • sleep_duration_minutes — int4 — 수면 시간 (분)
  • sleep_quality_score — int4 — 수면 품질 점수 (1-10)
  • deep_sleep_minutes — int4 — 깊은 수면 시간 (분)
  • light_sleep_minutes — int4 — 얕은 수면 시간 (분)
  • rem_sleep_minutes — int4 — REM 수면 시간 (분)
  • bedtime — time
  • wake_time — time
  • source — text — NOT NULL — 데이터 출처
  • notes — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

subscriptions

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • status — text — NOT NULL — 구독 상태: active, inactive, cancelled, paused
  • plan_type — text — NOT NULL
  • subscription_plan — text — NOT NULL — 구독 플랜: free, single, premium, enterprise (user_subscriptions 통합)
  • billing_key — text
  • payment_method — text
  • last_four_digits — text
  • started_at — timestamp — NOT NULL
  • current_period_start — timestamp — NOT NULL
  • current_period_end — timestamp — NOT NULL
  • expires_at — timestamp — 구독 만료일 (user_subscriptions 통합)
  • cancelled_at — timestamp
  • price_per_month — int4 — NOT NULL
  • total_paid — int4 — NOT NULL
  • is_active — bool — NOT NULL — 활성 상태 (user_subscriptions 통합)
  • is_test_mode — bool — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

user_deworming_records

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • family_member_id — uuid — Foreign key → family_members.id
  • medication_name — text — NOT NULL
  • dosage — text — NOT NULL
  • taken_date — date — NOT NULL
  • next_due_date — date
  • cycle_days — int4 — NOT NULL — 복용 주기
  • prescribed_by — text — 처방 의사/기관
  • notes — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

user_follows

  • id — uuid — Primary key — NOT NULL
  • follower_id — uuid — Foreign key → users.id — NOT NULL — 팔로우하는 사용자 ID
  • following_id — uuid — Foreign key → users.id — NOT NULL — 팔로우받는 사용자 ID
  • created_at — timestamp — NOT NULL

user_gamification

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • total_points — int4 — NOT NULL — 총 포인트
  • streak_days — int4 — NOT NULL — 연속 완료 일수
  • badges — text — NOT NULL — 획득한 배지 ID 배열
  • last_completed_date — timestamp — 마지막 알림 완료 날짜
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

user_health_checkup_records

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • family_member_id — uuid — Foreign key → family_members.id
  • checkup_type — text — NOT NULL — 검진 유형: national, cancer, special
  • checkup_date — date — NOT NULL
  • checkup_site — text
  • checkup_site_address — text
  • results — jsonb — NOT NULL — 검진 결과 데이터
  • next_recommended_date — date
  • overdue_days — int4 — 연체 일수
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

user_health_profiles

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • disliked_ingredients — text — NOT NULL
  • excluded_ingredients — jsonb — NOT NULL — 비선호 식재료 목록
  • premium_features — text — NOT NULL
  • height_cm — int4
  • weight_kg — numeric
  • age — int4
  • gender — text — 성별: male, female, other
  • activity_level — text — 활동 수준
  • daily_calorie_goal — int4
  • calorie_calculation_method — varchar — NOT NULL — 칼로리 계산 방식
  • manual_target_calories — int4 — 사용자가 직접 설정한 목표 칼로리
  • show_calculation_formula — bool — NOT NULL — 칼로리 계산 공식 표시 여부
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • vaccination_history — jsonb — NOT NULL — 과거 접종 이력
  • last_health_checkup_date — date — 마지막 건강검진 일자
  • region — text — 거주 지역
  • diseases — jsonb — NOT NULL — 사용자 질병 목록
  • allergies — jsonb — NOT NULL — 사용자 알레르기 목록
  • preferred_ingredients — jsonb — NOT NULL — 선호 식재료 목록
  • dietary_preferences — jsonb — NOT NULL — 프리미엄 식단 타입
  • birth_date — date — 사용자 생년월일

user_notification_settings

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • periodic_services_enabled — bool — NOT NULL — 주기적 서비스 알림 활성화
  • periodic_services_reminder_days — int4 — NOT NULL — 알림 일수 전
  • deworming_reminders_enabled — bool — NOT NULL — 구충제 복용 알림 활성화
  • vaccination_reminders_enabled — bool — NOT NULL
  • checkup_reminders_enabled — bool — NOT NULL
  • infection_risk_alerts_enabled — bool — NOT NULL
  • travel_risk_alerts_enabled — bool — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

user_vaccination_records

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • family_member_id — uuid — Foreign key → family_members.id
  • vaccine_name — text — NOT NULL
  • vaccine_code — text
  • target_age_group — text
  • scheduled_date — date
  • completed_date — date
  • dose_number — int4 — 접종 차수
  • total_doses — int4 — 총 접종 차수
  • vaccination_site — text
  • vaccination_site_address — text
  • reminder_enabled — bool — NOT NULL
  • reminder_days_before — int4 — NOT NULL
  • notes — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

users

  • id — uuid — Primary key — NOT NULL
  • clerk_id — text — NOT NULL — Clerk 사용자 ID (Unique)
  • name — text — NOT NULL
  • is_premium — bool — NOT NULL — 프리미엄 구독 여부
  • premium_expires_at — timestamp
  • trial_ends_at — timestamp
  • mfa_secret — text
  • mfa_enabled — bool — NOT NULL
  • mfa_backup_codes — text
  • notification_settings — jsonb — NOT NULL
  • created_at — timestamp — NOT NULL
  • trial_used_at — timestamp — 14일 무료 체험을 시작한 시각
  • bio — text — 사용자 소개글
  • profile_image_url — text — 프로필 이미지 URL
  • follower_count — int4 — NOT NULL — 팔로워 수
  • following_count — int4 — NOT NULL — 팔로잉 수
  • post_count — int4 — NOT NULL — 작성한 게시글 수
  • game_settings — jsonb — NOT NULL — 캐릭터창 게임 설정
  • home_customization — jsonb — 홈페이지 커스텀 설정

vital_signs

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • family_member_id — uuid — Foreign key → family_members.id
  • measured_at — timestamp — NOT NULL
  • systolic_bp — int4 — 수축기 혈압 (mmHg)
  • diastolic_bp — int4 — 이완기 혈압 (mmHg)
  • fasting_glucose — int4 — 공복 혈당 (mg/dL)
  • postprandial_glucose — int4 — 식후 혈당 (mg/dL)
  • heart_rate — int4 — 심박수 (bpm)
  • source — text — NOT NULL — 데이터 출처
  • notes — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

weekly_diet_plans

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • week_start_date — date — NOT NULL — 주차 시작일 (항상 월요일)
  • week_year — int4 — NOT NULL
  • week_number — int4 — NOT NULL — ISO 8601 주차 번호 (1-53)
  • is_family — bool — NOT NULL — 가족 식단 여부
  • total_recipes_count — int4 — NOT NULL
  • generation_duration_ms — int4
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

weekly_nutrition_stats

  • id — uuid — Primary key — NOT NULL
  • weekly_diet_plan_id — uuid — Foreign key → weekly_diet_plans.id — NOT NULL
  • day_of_week — int4 — NOT NULL — 요일 (0=일요일, 6=토요일)
  • date — date — NOT NULL
  • total_calories — numeric
  • total_carbohydrates — numeric
  • total_protein — numeric
  • total_fat — numeric
  • total_sodium — numeric
  • meal_count — int4 — NOT NULL
  • created_at — timestamp — NOT NULL

weekly_shopping_lists

  • id — uuid — Primary key — NOT NULL
  • weekly_diet_plan_id — uuid — Foreign key → weekly_diet_plans.id — NOT NULL
  • ingredient_name — text — NOT NULL
  • total_quantity — numeric
  • unit — text
  • category — text
  • recipes_using — jsonb — NOT NULL — 해당 재료를 사용하는 레시피 ID 목록
  • is_purchased — bool — NOT NULL
  • created_at — timestamp — NOT NULL

weight_logs

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • family_member_id — uuid — Foreign key → family_members.id
  • date — date — NOT NULL
  • weight_kg — numeric — NOT NULL — 체중 (kg)
  • body_fat_percentage — numeric — 체지방률 (%)
  • muscle_mass_kg — numeric — 근육량 (kg)
  • source — text — NOT NULL
  • notes — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL