2

Tables (7)

daily_logs

  • log_id — SERIAL — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key
  • exercise_id — SERIAL — Foreign key → exercises.exercise_id — NOT NULL
  • date — DATE
  • calculated_bmr — DOUBLE
  • calculated_tdee — DOUBLE
  • total_calories_in — DOUBLE
  • total_calories_out — DOUBLE
  • remaining_budget — INT

exercises

  • exercise_id — SERIAL — Primary key — NOT NULL
  • exercise_name — VARCHAR(30) — NOT NULL
  • met_value — DOUBLE

food_logs

  • food_log_id — SERIAL — Primary key — NOT NULL
  • log_id — BIGINT — Foreign key
  • food_id — BIGINT — Foreign key
  • meal_type — VARCHAR(10)
  • quantity_g — DOUBLE
  • spent_money — INT

foods

  • food_id — SERIAL — Primary key — NOT NULL
  • food_name — VARCHAR(50) — NOT NULL
  • category — VARCHAR(20)
  • meal_tag — VARCHAR(20)
  • price — INT — NOT NULL
  • calories — DOUBLE — NOT NULL
  • protein — DOUBLE — NOT NULL
  • fat — DOUBLE — NOT NULL
  • carbs — DOUBLE — NOT NULL
  • protein_per_price — DOUBLE

recommend_logs

  • recommend_id — SERIAL — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key
  • log_id — BIGINT — Foreign key
  • recommend_type — VARCHAR(20)
  • recommended_items — JSONB
  • is_accepted — BOOLEAN
  • created_at — TIMESTAMP

user_profiles

  • profile_id (Key) — SERIAL — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key
  • height — DOUBLE — NOT NULL
  • weight — DOUBLE — NOT NULL
  • target_weight — DOUBLE
  • activity_level — DOUBLE
  • goal_type — VARCHAR(20)
  • has_supplement — BOOLEAN
  • daily_budget — INT
  • recorded_at — TIMESTAMP

users

  • user_id — SERIAL — Primary key — NOT NULL
  • email — VARCHAR(50) — NOT NULL
  • name — VARCHAR(20)
  • gender — CHAR(1)
  • birth_date — DATE
  • created_at — TIMESTAMP