create user table
This commit is contained in:
parent
541e35bc51
commit
404f3757b4
|
@ -1,7 +1,5 @@
|
||||||
from sqlalchemy import MetaData
|
from sqlalchemy import MetaData
|
||||||
from sqlalchemy.orm import DeclarativeBase
|
from sqlalchemy.orm import DeclarativeBase
|
||||||
from sqlalchemy.orm import Mapped
|
|
||||||
from sqlalchemy.orm import mapped_column
|
|
||||||
from sqlalchemy.orm import declared_attr
|
from sqlalchemy.orm import declared_attr
|
||||||
|
|
||||||
from config import settings
|
from config import settings
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
from sqlalchemy.orm import Mapped, mapped_column
|
||||||
|
from sqlalchemy import BigInteger
|
||||||
from config import settings
|
from config import settings
|
||||||
from models import Base
|
from models import Base
|
||||||
from models.mixins import IdIntPkMixin
|
from models.mixins import IdIntPkMixin
|
||||||
|
@ -12,7 +14,9 @@ if TYPE_CHECKING:
|
||||||
from sqlalchemy.ext.asyncio import AsyncSession
|
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
|
@classmethod
|
||||||
def get_db(cls, session: "AsyncSession"):
|
def get_db(cls, session: "AsyncSession"):
|
||||||
|
|
Loading…
Reference in New Issue