v2

Tables (14)

brand (브랜드)

  • brand_id (pk) — Primary key — NOT NULL
  • name (브랜드 명) — string
  • img_url (대표 이미지) — string
  • category (종류 (편의점, 식당, 밀키트)) — enum

center (지점)

  • center_id (pk) — Primary key — NOT NULL
  • brand_id (pk2) — Foreign key → brand.brand_id — NOT NULL
  • address (주소)
  • name (매장명)

center_keyword (지점별 키워드)

  • center_keyword_id (pk) — Primary key — NOT NULL
  • center_id (pk2) — Foreign key → center.center_id — NOT NULL

day_meal (일일 식단)

  • day_meal_id (pk) — Primary key — NOT NULL
  • breakfast (recipe_id or product_id 1) — Foreign key → recipe.recipe_id — NOT NULL
  • breakfast_type (아침 타입) — enum
  • lunch (recipe_id or product_id 2) — Foreign key → recipe.recipe_id — NOT NULL
  • lunch_type (점심 타입) — enum
  • dinner (recipe_id or product_id 3) — Foreign key → product.product_id — NOT NULL
  • dinner_type (저녁 타입) — enum

day_meal_plan (식단-일일 식단 내역)

  • meal_plan_id (pk) — Foreign key → meal_plan.meal_plan_id — NOT NULL
  • day_meal_id (pk2) — Foreign key → day_meal.day_meal_id — NOT NULL
  • meal_date (식단 날짜)

keyword (키워드)

  • keyword_id (pk) — Primary key — NOT NULL
  • recipe_id (pk2) — Foreign key → recipe.recipe_id — NOT NULL
  • product_id (pk3) — Foreign key → product.product_id — NOT NULL
  • type (타입 (질병, 라이프스타일, 알레르기, 식사시간대)) — enum
  • name (키워드 명) — string

meal_plan (식단)

  • meal_plan_id (pk) — Primary key — NOT NULL
  • user_id (pk2) — Foreign key → users.user_id — NOT NULL
  • survey_id (pk3) — Foreign key → survey.survey_id — NOT NULL

nutrient (영양성분)

  • nutrient_id (pk) — Primary key — NOT NULL
  • product_id (pk2) — Foreign key → product.product_id — NOT NULL
  • recipe_id (pk4) — Foreign key → recipe.recipe_id — NOT NULL
  • carb (탄수화물) — float
  • protein (단백질) — float
  • fat (지방) — float
  • calorie (칼로리) — float
  • sugar (당류) — float
  • saturated_fat (포화지방) — float
  • unsaturated_fat (불포화지방) — float
  • trans_fat (트랜스지방) — float
  • cholesterol (콜레스테롤) — float
  • fiber (식이섬유) — float
  • sodium (나트륨) — float
  • potassium (칼륨) — float

product (상품)

  • product_id (pk) — Primary key — NOT NULL
  • brand_id (fk) — Foreign key → brand.brand_id — NOT NULL
  • name (상품명) — string
  • price (금액) — number
  • img_url (상품 이미지) — string

recipe (레시피)

  • recipe_id (pk) — Primary key — NOT NULL
  • summary (요약) — string
  • level (난이도 (상, 중, 하)) — enum
  • type (타입 (메인, 서브)) — enum
  • serving (식사량) — number
  • category (분류 (요리 레시피, 간편 레시피)) — enum
  • instructions (재료) — array
  • author (저자) — string
  • cooking_time (요리시간) — number
  • img_url (대표 이미지) — string
  • instructions (요리방법) — array
  • ori_url (원본링크) — string
  • platform (플랫폼) — string
  • publish_at (게시일) — datetime
  • title (레시피 제목) — string
  • tools (요리도구) — array

survey (사전조사)

  • survey_id (pk) — Primary key — NOT NULL
  • step1 (1단계 입력 값) — string
  • step2 (2단계 입력 값) — array
  • step3 (3단계 입력 값) — array
  • step4 (4단계 입력 값) — string
  • step5 (5단계 입력 값) — array
  • step6 (6단계 입력 값) — array
  • step7 (7단계 입력 값) — array
  • email (설문 참여자 이메일) — string

user_social_accounts (소셜 로그인 정보)

  • user_social_accounts_id (pk) — Primary key — NOT NULL
  • user_id (pk2) — Foreign key → users.user_id — NOT NULL
  • provider (제공자) — string
  • social_id (연동 계정의 토큰) — string
  • social_email (연동 이메일) — string

user_tokens (유저 로그인 토큰)

  • user_token_id (pk) — Primary key — NOT NULL
  • user_id (pk2) — Foreign key → users.user_id — NOT NULL
  • token (토큰) — string
  • expires_at (만료일시) — datetime

users (유저)

  • user_id (pk) — Primary key — NOT NULL
  • email (이메일) — string
  • password (비밀번호) — string
  • name (이름) — string