mirror of
https://github.com/Balshgit/gpt_chat_bot.git
synced 2026-02-03 11:40:39 +03:00
add question count table (#73)
* update admin url * update log level * add user question count table * rename ChatGpt to ChatGptModels * change user to root in ci tests * add chatgpt_shared volume
This commit is contained in:
@@ -20,3 +20,10 @@ class AccessToken(SQLAlchemyBaseAccessTokenTable[Mapped[int]], Base):
|
||||
@declared_attr
|
||||
def user_id(cls) -> Mapped[int]:
|
||||
return mapped_column(INTEGER, ForeignKey("users.id", ondelete="cascade"), nullable=False)
|
||||
|
||||
|
||||
class UserQuestionCount(Base):
|
||||
__tablename__ = "user_question_count" # type: ignore[assignment]
|
||||
|
||||
user_id: Mapped[int] = mapped_column(INTEGER, ForeignKey("users.id", ondelete="cascade"), primary_key=True)
|
||||
question_count: Mapped[int] = mapped_column(INTEGER, default=0, nullable=False)
|
||||
|
||||
Reference in New Issue
Block a user