ㄴ
Tables (16)
ai_meal_scores
- score_id — INT — Primary key — NOT NULL
- meal_id — INT — Foreign key → meal_records.meal_id — NOT NULL
- ai_score — DECIMAL(5,2) — NOT NULL
- ai_feedback — TEXT
- calculated_at — DATETIME — NOT NULL
board_categories
- category_id — INT — Primary key — NOT NULL
- category_name — VARCHAR(50) — NOT NULL
challenges
- challenge_id — INT — Primary key — NOT NULL
- title — VARCHAR(255) — NOT NULL
- description — TEXT
- start_date — DATE
- end_date — DATE
- image_url — VARCHAR(255)
comments
- comment_id — INT — Primary key — NOT NULL
- post_id — INT — Foreign key → posts.post_id — NOT NULL
- user_id — INT — Foreign key → users.user_id — NOT NULL
- content — TEXT — NOT NULL
- parent_comment_id — INT — Foreign key → comments.comment_id
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME
follows
- follower_id — INT — Foreign key → users.user_id — NOT NULL
- following_id — INT — Foreign key → users.user_id — NOT NULL
food_recommendations
- recommendation_id — INT — Primary key — NOT NULL
- user_id — INT — Foreign key → users.user_id — NOT NULL
- food_id — INT — Foreign key → foods.food_id — NOT NULL
- reason — VARCHAR(255)
- recommended_at — DATETIME — NOT NULL
foods
- food_id — INT — Primary key — NOT NULL
- food_name — VARCHAR(255) — NOT NULL
- serving_size_g — DECIMAL(10,2)
- calories — DECIMAL(10,2)
- protein_g — DECIMAL(10,2)
- fat_g — DECIMAL(10,2)
- carbs_g — DECIMAL(10,2)
- sugar_g — DECIMAL(10,2)
- sodium_mg — DECIMAL(10,2)
- source — VARCHAR(50)
meal_details
- meal_detail_id — INT — Primary key — NOT NULL
- meal_id — INT — Foreign key → meal_records.meal_id — NOT NULL
- food_id — INT — Foreign key → foods.food_id — NOT NULL
- quantity_g — DECIMAL(10,2) — NOT NULL
meal_photos
- meal_photo_id — INT — Primary key — NOT NULL
- meal_id — INT — Foreign key → meal_records.meal_id — NOT NULL
- photo_url — VARCHAR(255) — NOT NULL
- uploaded_at — DATETIME — NOT NULL
meal_records
- meal_id — INT — Primary key — NOT NULL
- user_id — INT — Foreign key → users.user_id — NOT NULL
- meal_date — DATETIME — NOT NULL
- meal_type — VARCHAR(20) — NOT NULL
- created_at — DATETIME — NOT NULL
posts
- post_id — INT — Primary key — NOT NULL
- user_id — INT — Foreign key → users.user_id — NOT NULL
- category_id — INT — Foreign key → board_categories.category_id — NOT NULL
- title — VARCHAR(255) — NOT NULL
- content — TEXT
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME
- view_count — INT — NOT NULL
recipe_ingredients
- recipe_ingredient_id — INT — Primary key — NOT NULL
- recipe_id — INT — Foreign key → recipes.recipe_id — NOT NULL
- food_id — INT — Foreign key → foods.food_id — NOT NULL
- quantity_g — DECIMAL(10,2) — NOT NULL
- description — VARCHAR(100)
recipe_steps
- recipe_step_id — INT — Primary key — NOT NULL
- recipe_id — INT — Foreign key → recipes.recipe_id — NOT NULL
- step_number — INT — NOT NULL
- instruction — TEXT — NOT NULL
recipes
- recipe_id — INT — Primary key — NOT NULL
- recipe_name — VARCHAR(255) — NOT NULL
- description — TEXT
- author_user_id — INT — Foreign key → users.user_id
- prep_time_min — INT
- cook_time_min — INT
- serving_size — INT
- created_at — DATETIME — NOT NULL
user_challenges
- user_challenge_id — INT — Primary key — NOT NULL
- user_id — INT — Foreign key → users.user_id — NOT NULL
- challenge_id — INT — Foreign key → challenges.challenge_id — NOT NULL
- join_date — DATETIME — NOT NULL
- status — VARCHAR(20) — NOT NULL
- progress_percent — INT — NOT NULL
users
- user_id — INT — Primary key — NOT NULL
- email — VARCHAR(100) — NOT NULL
- password — VARCHAR(255) — NOT NULL
- user_name — VARCHAR(50) — NOT NULL
- phone_number — VARCHAR(20)
- gender — VARCHAR(10)
- birth_date — DATE
- height_cm — DECIMAL(5,2)
- weight_kg — DECIMAL(5,2)
- status — VARCHAR(20) — NOT NULL
- reg_date — DATETIME — NOT NULL