ервый импорт проекта

This commit is contained in:
Арсентьев Александр
2026-08-06 00:01:51 +03:00
commit a2ac226028
9523 changed files with 999716 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
"""UserRole model."""
from sqlalchemy import Column, Integer, ForeignKey
from sqlalchemy.orm import relationship
from 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")