diff --git a/dakiny_bot/database/models.py b/dakiny_bot/database/models.py index 0f8c5ae..7fd363d 100644 --- a/dakiny_bot/database/models.py +++ b/dakiny_bot/database/models.py @@ -1,6 +1,6 @@ """File holds all model definitions of SQL tables.""" -from sqlalchemy.dialects.mysql import BIGINT, VARCHAR +from sqlalchemy.dialects.mysql import BIGINT, INTEGER, VARCHAR from sqlmodel import Column, Field, ForeignKey, Relationship, SQLModel @@ -131,3 +131,18 @@ class UserBirthday(SQLModel, table=True): # TODO(imcompiling): split into month and day. Also relies on Alembic migration. # https://gitea.cheezers.org/imcompiling/dakiny-bot/issues/93 birthday: str = Field(sa_column=Column("Birthday", VARCHAR, nullable=False), max_length=5) + + +class Presence(SQLModel, table=True): + """ + Stores presences for the bot to pull and use. + + Attributes: + id: Auto-incremented id for each entry. + presence: The presence itself. + """ + + __tablename__: str = "Presences" + + id: int | None = Field(sa_column=Column("Id", INTEGER, primary_key=True), default=None) + presence: str = Field(sa_column=Column("Presence", VARCHAR, nullable=False), max_length=100)