fix
This commit is contained in:
@@ -2,7 +2,7 @@ import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import String, Float, Integer, DateTime, ForeignKey, func
|
||||
from sqlalchemy.dialects.postgresql import UUID
|
||||
from sqlalchemy.dialects.postgresql import UUID, JSONB
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from backend.app.core.database import Base
|
||||
@@ -20,6 +20,12 @@ class Activity(Base):
|
||||
distance: Mapped[float | None] = mapped_column(Float, nullable=True) # meters
|
||||
elevation_gain: Mapped[float | None] = mapped_column(Float, nullable=True) # meters
|
||||
file_path: Mapped[str | None] = mapped_column(String(500), nullable=True)
|
||||
exercise_sets: Mapped[list | None] = mapped_column(JSONB, nullable=True) # [{exercise_name, reps, weight, duration}]
|
||||
|
||||
# Link to training plan workout
|
||||
training_plan_id: Mapped[uuid.UUID | None] = mapped_column(UUID(as_uuid=True), ForeignKey("training_plans.id"), nullable=True)
|
||||
plan_week: Mapped[int | None] = mapped_column(Integer, nullable=True)
|
||||
plan_day: Mapped[str | None] = mapped_column(String(20), nullable=True) # monday, tuesday, ...
|
||||
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user