16 lines
656 B
Python
16 lines
656 B
Python
from sqlalchemy import SmallInteger, Text, String
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.database import Base, TimestampMixin
|
|
|
|
|
|
class Announcement(TimestampMixin, Base):
|
|
__tablename__ = "announcements"
|
|
|
|
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
|
|
title: Mapped[str] = mapped_column(String(100), nullable=False)
|
|
content: Mapped[str] = mapped_column(Text, nullable=False)
|
|
is_pinned: Mapped[int] = mapped_column(SmallInteger, default=0, nullable=False)
|
|
is_published: Mapped[int] = mapped_column(SmallInteger, default=1, nullable=False)
|
|
created_by: Mapped[int | None] = mapped_column()
|