test

Tables (9)

conditions

  • id — INT
  • code — VARCHAR(64)
  • name_ko — VARCHAR(100) — NOT NULL

diet_records

  • id — INT
  • user_id — VARCHAR(50) — NOT NULL
  • food_id — INT — NOT NULL
  • meal_date — DATE — NOT NULL
  • meal_type — ENUM('BREAKFAST','LUNCH','DINNER','SNACK') — NOT NULL
  • serving — DECIMAL(6,2)
  • created_at — DATETIME
  • INDEX — idx_dr_user_date
  • INDEX — idx_dr_food_date

food_nutrients

  • food_id — INT — Primary key — NOT NULL
  • nutrient — VARCHAR(32) — Primary key — NOT NULL
  • amount — DECIMAL(10,3) — NOT NULL

foods

  • id — INT
  • food_name — VARCHAR(100) — NOT NULL
  • calorie — DECIMAL(7,2)
  • protein — DECIMAL(7,2)
  • carbs — DECIMAL(7,2)
  • fat — DECIMAL(7,2)
  • serving_g — DECIMAL(7,2)
  • created_at — DATETIME

medications

  • id — INT
  • name — VARCHAR(128) — NOT NULL
  • atc — VARCHAR(32)

nutrients

  • code — VARCHAR(32)
  • name_ko — VARCHAR(100) — NOT NULL
  • unit — VARCHAR(16) — NOT NULL

user_conditions

  • user_id — VARCHAR(50) — Primary key — NOT NULL
  • condition_id — INT — Primary key — NOT NULL
  • severity — ENUM('MILD','MODERATE','SEVERE')
  • noted_at — DATETIME

user_medications

  • user_id — VARCHAR(50) — Primary key — NOT NULL
  • medication_id — INT — Primary key — NOT NULL
  • dosage — VARCHAR(64)
  • start_date — DATE
  • end_date — DATE

users

  • id — VARCHAR(50)
  • password — VARCHAR(255) — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • birth_date — DATE
  • gender — ENUM('M','F','OTHER')
  • height_cm — DECIMAL(5,2)
  • weight_kg — DECIMAL(5,2)
  • created_at — DATETIME