connect database

This commit is contained in:
2025-09-27 09:13:20 +03:00
parent 5982351dd2
commit 1a49545fff
16 changed files with 180 additions and 38 deletions

View File

@@ -6,16 +6,17 @@ from sqlalchemy import (
ForeignKey,
func,
)
from sqlalchemy.orm import Mapped, mapped_column
from sqlalchemy.orm import Mapped, declarative_base, mapped_column
from app.db.database import Base
Base = declarative_base()
class User(Base):
__tablename__ = "user"
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
tg_id: Mapped[int] = mapped_column(BigInteger, unique=True, nullable=False)
fullname: Mapped[str] = mapped_column()
tg_id: Mapped[int] = mapped_column(BigInteger)
role: Mapped[str] = mapped_column(default="user")
phone: Mapped[str] = mapped_column(nullable=True)