20 lines
635 B
Python
20 lines
635 B
Python
|
|
"""AdminUser SQLAlchemy model."""
|
||
|
|
|
||
|
|
from datetime import datetime
|
||
|
|
|
||
|
|
from sqlalchemy import Integer, String, func
|
||
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
||
|
|
|
||
|
|
from app.database import Base
|
||
|
|
|
||
|
|
|
||
|
|
class AdminUser(Base):
|
||
|
|
"""Admin user for backend authentication."""
|
||
|
|
|
||
|
|
__tablename__ = "admin_users"
|
||
|
|
|
||
|
|
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
||
|
|
username: Mapped[str] = mapped_column(String(64), unique=True, nullable=False)
|
||
|
|
password_hash: Mapped[str] = mapped_column(String(255), nullable=False)
|
||
|
|
created_at: Mapped[datetime] = mapped_column(server_default=func.now(), nullable=False)
|