Skip to content

프로젝트 DB 설계 #2

@Piome98

Description

@Piome98

개발 순서에 따른 DB 설계입니다.

세부 일정은 본 문서 개시 이후 공지해드리겠습니다

📌 DB 설계 초안

Image

📌 DB 설계 (확정)
🔥Fithub DB: 개념적 설계 - ERD

📌User Section

💠User Table

  • Fields: id(PK), username, email, password, first_name, last_name, date_joined, last_login, is_active, is_staff, profile_image

💠UserProfile Table

  • Fields: id(PK), user(FK), birth_date, gender, height, weight, fitness_goal, activity_level, created_at, updated_at

💠SocialAccount Table

  • Fields: id(PK), user(FK), provider, provider_id, created_at

💡Relations

  • User : UserProfile = 1 : 1
  • User : SocialAccount = 1 : N

📌Ecommerce Section

💠Cateogry Table

  • Fields: id(PK), name, slug, description, parent(FK), is_active

💠Product Table

  • Fields: id(PK), name, slug, description, price, sale_price, stock_quantity, category(FK), is_food, is_active, is_featured

💠Order Table

  • Fields: id(PK), user(FK), order_number, status, total_amount, payment_method, shipping_address

💡Relations

  • Category : Product = 1 : N
  • User : Order = 1 : N
  • Product : Order = 1 : N

📌Workouts Section

💠Exercise Table

  • Fields: id(PK), name, description, muscle_groups(M2M), equipment_needed(M2M), difficulty_level

💠WorkoutRoutine Table

  • Fields: id(PK), user(FK), name, description, difficulty_level, estimated_duration, is_public, is_featured

💠WorkoutLog Table

  • Fields: id(PK), user(FK), routine(FK), start_time, end_time, duration_minutes, calories_burned, rating, mood

💠RoutineExercise Table

  • Fields:id(PK), routine(FK), exercise(FK), sets, reps, order

💡Relations

  • User : WorkoutRoutine = 1 : N
  • User : WorkoutLog = 1 : N
  • WorkoutRoutine : RoutineExercise = N : M
  • Exercise : RouineExercise = N : M

📌Diet Section

💠Food Table

  • Fields: id(PK), name, description, category(FK), calories, protein, carbs, fat, serving_size, user(FK), product(FK)

💠MealPlan Table

  • Fields: id(PK), user(FK), name, description, start_date, end_date, total_calories, is_active, template(FK), meal_of_day

💠DietLog Table

  • Fields: id(PK), user(FK), date, meal_type, food(FK), product(FK), quantity, calories

💡Relations

  • Food : User = 1 : N
  • MealPlan : User = 1 : N
  • Food : DietLog = 1 : N
  • Food: MealPlan = N : M

📌Community Section

💠Post Table

  • Fields: id(PK), user(FK), title, content

💠Comment Table

  • Fields: id(PK), post(FK), user(FK), content

💠Like T able

  • Fields: id(PK), user(FK), content_type, object_id

💡Relations

  • Post : Comment = 1 : N
  • Post : Like = N : M
  • User : Post = 1 : N
  • User : Comment = 1 : N
  • User : Like = 1 : N

Image

🔥Fithub DB: 논리적 설계

Image

🔥Fithub DB: 물리적 설계(Django model physical scheme)

Image

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

PRD

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions