From 3e030456df154407ab2747b3374737b54caeff3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80?= <78488229+viktor138irk@users.noreply.github.com> Date: Fri, 8 May 2026 04:24:00 +0900 Subject: [PATCH] Add persistent human-readable bot log model --- app/models.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/models.py b/app/models.py index aeb98c4..e5d75ad 100644 --- a/app/models.py +++ b/app/models.py @@ -85,6 +85,18 @@ class NewsSignal(Base): created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(timezone.utc), nullable=False) +class BotLog(Base): + __tablename__ = 'bot_logs' + id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True) + level: Mapped[str] = mapped_column(String(16), nullable=False, default='info') + event: Mapped[str] = mapped_column(String(64), nullable=False, default='message') + message: Mapped[str] = mapped_column(Text, nullable=False) + market: Mapped[str] = mapped_column(String(32), nullable=False, default='') + action: Mapped[str] = mapped_column(String(16), nullable=False, default='') + score: Mapped[float] = mapped_column(Float, nullable=False, default=0.0) + created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(timezone.utc), nullable=False, index=True) + + class ChartHistoryPoint(Base): __tablename__ = 'chart_history' id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)