You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
838 B
19 lines
838 B
from sqlalchemy.orm import Mapped, mapped_column
|
|
from sqlalchemy import String, Boolean
|
|
from sqlalchemy import TIMESTAMP
|
|
from . import Base
|
|
|
|
class User(Base):
|
|
__tablename__ = "users"
|
|
|
|
id: Mapped[int] = mapped_column(primary_key=True)
|
|
username: Mapped[str] = mapped_column(String(50), unique=True)
|
|
email: Mapped[str] = mapped_column(String(100), unique=True)
|
|
password_hash: Mapped[str] = mapped_column(String(255))
|
|
full_name: Mapped[str] = mapped_column(String(100))
|
|
is_active: Mapped[bool] = mapped_column(Boolean, default=True)
|
|
sort: Mapped[int] = mapped_column(default=0)
|
|
last_login: Mapped[str | None] = mapped_column(TIMESTAMP(timezone=True), nullable=True)
|
|
created_at: Mapped[str] = mapped_column(TIMESTAMP(timezone=True))
|
|
updated_at: Mapped[str] = mapped_column(TIMESTAMP(timezone=True))
|