Files
keywarden/app/models/user.py
boris f04b04339f
Some checks failed
CI / Lint & Format (push) Has been cancelled
CI / Tests (Pytest + Alembic + Postgres) (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
Linted .py files
2025-09-22 20:34:29 +01:00

15 lines
639 B
Python

from sqlalchemy import Boolean, String
from sqlalchemy.orm import Mapped, declarative_base, mapped_column
# only for Alembic discovery, not used here
from app.db.session import engine # noqa: F401
Base = declarative_base()
class User(Base):
__tablename__ = "users"
id: Mapped[int] = mapped_column(primary_key=True, index=True)
email: Mapped[str] = mapped_column(String(254), unique=True, index=True)
hashed_password: Mapped[str | None] = mapped_column(String(255))
role: Mapped[str] = mapped_column(String(32), default="user") # user|admin|auditor
is_active: Mapped[bool] = mapped_column(Boolean, default=True)