Prepare ERP source for Gitea deployment

This commit is contained in:
A R R R Associates
2026-06-20 15:01:44 +05:30
commit 5c75eb6bd9
450 changed files with 67698 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
from __future__ import annotations
from datetime import datetime
from sqlalchemy import Integer, String, ForeignKey, DateTime, Boolean, UniqueConstraint
from sqlalchemy.orm import Mapped, mapped_column
from app.core.db.common import CommonBase
class RefreshToken(CommonBase):
__tablename__ = "refresh_tokens"
__table_args__ = (UniqueConstraint("token_hash", name="uq_refresh_token_hash"),)
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
user_id: Mapped[int] = mapped_column(ForeignKey("users.id", ondelete="CASCADE"), index=True)
token_hash: Mapped[str] = mapped_column(String(64), index=True) # sha256 hex
created_at_utc: Mapped[datetime] = mapped_column(DateTime, nullable=False)
expires_at_utc: Mapped[datetime] = mapped_column(DateTime, nullable=False)
revoked: Mapped[bool] = mapped_column(Boolean, default=False)
rotated_from_id: Mapped[int | None] = mapped_column(Integer, nullable=True)