add newsletter

This commit is contained in:
2026-05-20 10:11:47 +03:00
parent 2cc2f12a21
commit 5c7a9710f3
9 changed files with 957 additions and 11 deletions

View File

@@ -108,6 +108,33 @@ class SubscriptionRequestLog(Base):
synced_at: Mapped[datetime] = mapped_column(DateTime, nullable=False, default=utcnow)
class Guide(Base):
__tablename__ = "guides"
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
title: Mapped[str] = mapped_column(String(255), nullable=False)
short_description: Mapped[str] = mapped_column(String(512), nullable=False, default="")
body_text: Mapped[str] = mapped_column(Text, nullable=False)
is_active: Mapped[bool] = mapped_column(Boolean, nullable=False, default=True, index=True)
created_by_telegram_id: Mapped[int | None] = mapped_column(BigInteger, nullable=True, index=True)
created_at: Mapped[datetime] = mapped_column(DateTime, nullable=False, default=utcnow)
updated_at: Mapped[datetime] = mapped_column(DateTime, nullable=False, default=utcnow, onupdate=utcnow)
class GuidePhoto(Base):
__tablename__ = "guide_photos"
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
guide_id: Mapped[int] = mapped_column(
ForeignKey("guides.id", ondelete="CASCADE"),
nullable=False,
index=True,
)
file_id: Mapped[str] = mapped_column(String(512), nullable=False)
position: Mapped[int] = mapped_column(Integer, nullable=False, default=0)
created_at: Mapped[datetime] = mapped_column(DateTime, nullable=False, default=utcnow)
class SupportTicket(Base):
__tablename__ = "support_tickets"
__table_args__ = (