create user table

This commit is contained in:
s.mostryukov 2024-10-02 12:50:08 +03:00
parent 541e35bc51
commit 404f3757b4
4 changed files with 5 additions and 3 deletions

View File

View File

View File

@ -1,7 +1,5 @@
from sqlalchemy import MetaData
from sqlalchemy.orm import DeclarativeBase
from sqlalchemy.orm import Mapped
from sqlalchemy.orm import mapped_column
from sqlalchemy.orm import declared_attr
from config import settings

View File

@ -1,3 +1,5 @@
from sqlalchemy.orm import Mapped, mapped_column
from sqlalchemy import BigInteger
from config import settings
from models import Base
from models.mixins import IdIntPkMixin
@ -12,7 +14,9 @@ if TYPE_CHECKING:
from sqlalchemy.ext.asyncio import AsyncSession
class User(Base, IdIntPkMixin, SQLAlchemyBaseUserTable[settings.types.UserIdType]):
class User(Base, IdIntPkMixin, SQLAlchemyBaseUserTable[settings.type.UserIdType]):
name: Mapped[str] = mapped_column(nullable=True)
tg_id: Mapped[int] = mapped_column(BigInteger, nullable=True)
@classmethod
def get_db(cls, session: "AsyncSession"):