diff --git a/app/models/user.py b/app/models/user.py index a2469c8..eab4d50 100644 --- a/app/models/user.py +++ b/app/models/user.py @@ -27,6 +27,12 @@ class User(Base, TenantMixin): name: Mapped[str] = mapped_column(String(200), nullable=False) password_hash: Mapped[str] = mapped_column(String(255), nullable=False) role: Mapped[str] = mapped_column(String(50), nullable=False, default="viewer") + role_id: Mapped[uuid.UUID | None] = mapped_column( + PGUUID(as_uuid=True), + ForeignKey("roles.id", ondelete="SET NULL"), + nullable=True, + index=True, + ) is_active: Mapped[bool] = mapped_column(Boolean, default=True, nullable=False) preferences: Mapped[dict[str, Any]] = mapped_column(JSONB, default=dict, nullable=False)