from sqlalchemy import String, DateTime, Integer
from sqlalchemy.orm import Mapped, mapped_column, DeclarativeBase

class Base(DeclarativeBase):
    pass

class User(Base):
    __tablename__ = "users"

    id: Mapped[int] = mapped_column(primary_key=True)
    name: Mapped[str] = mapped_column(String(255),nullable=False)
    username: Mapped[str] = mapped_column(String(150),nullable=False)
    register_date: Mapped[DateTime] = mapped_column(DateTime, nullable=False)
    last_visit_date: Mapped[DateTime] = mapped_column(DateTime, nullable=True)
    email: Mapped[str] = mapped_column(String(255),nullable=False)
    password: Mapped[str] = mapped_column(String(100),nullable=False)
    block: Mapped[str] = mapped_column(Integer,nullable=False)
