Adds a per-user Morning Routine item list that appears in the TV dashboard Activities panel during the "Good Morning" countdown (before the first block starts). - morning_routine_items table (auto-created on startup) - CRUD API at /api/morning-routine (auth-required) - Items included in the public DashboardSnapshot so TV gets them without auth - Morning Routine section in Admin page (same add/edit/delete UX as subject options) - TV Activities column shows routine items when no block is active, switches to subject options once a block starts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
16 lines
588 B
Python
16 lines
588 B
Python
from sqlalchemy import ForeignKey, Integer, Text
|
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
|
|
from app.models.base import Base
|
|
|
|
|
|
class MorningRoutineItem(Base):
|
|
__tablename__ = "morning_routine_items"
|
|
|
|
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
|
|
user_id: Mapped[int] = mapped_column(ForeignKey("users.id", ondelete="CASCADE"), nullable=False)
|
|
text: Mapped[str] = mapped_column(Text, nullable=False)
|
|
order_index: Mapped[int] = mapped_column(Integer, default=0)
|
|
|
|
user: Mapped["User"] = relationship("User") # noqa: F821
|