17 lines
664 B
Python
17 lines
664 B
Python
from sqlalchemy import Boolean, Integer, String, func
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
from datetime import datetime
|
|
|
|
from app.database import Base
|
|
|
|
|
|
class AdminUser(Base):
|
|
__tablename__ = "admin_users"
|
|
|
|
id: Mapped[int] = mapped_column(Integer, primary_key=True)
|
|
email: Mapped[str] = mapped_column(String(200), unique=True, nullable=False)
|
|
password_hash: Mapped[str] = mapped_column(String(200), nullable=False)
|
|
name: Mapped[str] = mapped_column(String(200), nullable=False, default="Admin")
|
|
is_active: Mapped[bool] = mapped_column(Boolean, default=True)
|
|
created_at: Mapped[datetime] = mapped_column(default=func.now())
|