6c86f0f571
- integrated request-module into module registry - moved backend into modules/request-module - added manifest.json and module.py - implemented dynamic router mounting - implemented dynamic static mounting - removed direct dependencies from platform core - verified startup with request-module - verified startup without request-module - added implementation_report_003.md
19 lines
630 B
Python
19 lines
630 B
Python
"""UserRole model."""
|
|
|
|
from sqlalchemy import Column, Integer, ForeignKey
|
|
from sqlalchemy.orm import relationship
|
|
from request_app.models.base import Base, TimestampMixin
|
|
|
|
|
|
class UserRole(Base, TimestampMixin):
|
|
"""UserRole model."""
|
|
|
|
__tablename__ = "user_roles"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
user_id = Column(Integer, ForeignKey("users.id", ondelete="CASCADE"), nullable=False)
|
|
role_id = Column(Integer, ForeignKey("roles.id", ondelete="CASCADE"), nullable=False)
|
|
|
|
user = relationship("User", back_populates="user_roles")
|
|
role = relationship("Role", back_populates="user_roles")
|