This is the initial push of the outline of the life dashboard
This commit is contained in:
17
backend/app/models/weight.py
Normal file
17
backend/app/models/weight.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from datetime import date, datetime
|
||||
|
||||
from sqlalchemy import Date, Numeric, Text, func
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from app.database import Base
|
||||
|
||||
|
||||
class WeightEntry(Base):
|
||||
__tablename__ = "weight_entries"
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
date: Mapped[date] = mapped_column(Date, unique=True)
|
||||
weight_lbs: Mapped[float] = mapped_column(Numeric(5, 1))
|
||||
body_fat_pct: Mapped[float | None] = mapped_column(Numeric(4, 1), nullable=True)
|
||||
notes: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
created_at: Mapped[datetime] = mapped_column(server_default=func.now())
|
||||
Reference in New Issue
Block a user