20 lines
903 B
Python
20 lines
903 B
Python
from sqlalchemy import String, Text, Boolean, func
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
from app.database import Base
|
|
|
|
|
|
class Reminder(Base):
|
|
__tablename__ = "reminders"
|
|
|
|
id: Mapped[int] = mapped_column(primary_key=True, index=True)
|
|
title: Mapped[str] = mapped_column(String(255), nullable=False)
|
|
description: Mapped[Optional[str]] = mapped_column(Text, nullable=True)
|
|
remind_at: Mapped[datetime] = mapped_column(nullable=False)
|
|
is_active: Mapped[bool] = mapped_column(Boolean, default=True)
|
|
is_dismissed: Mapped[bool] = mapped_column(Boolean, default=False)
|
|
recurrence_rule: Mapped[Optional[str]] = mapped_column(String(255), nullable=True)
|
|
created_at: Mapped[datetime] = mapped_column(default=func.now())
|
|
updated_at: Mapped[datetime] = mapped_column(default=func.now(), onupdate=func.now())
|