Add Workspace.roles
This commit is contained in:
@@ -11,10 +11,10 @@ class Workspace(Base, TimestampsMixin):
|
||||
|
||||
id = Id()
|
||||
name = Column(String, unique=True)
|
||||
|
||||
request_id = Column(ForeignKey("requests.id"), nullable=False)
|
||||
request = relationship("Request")
|
||||
projects = relationship("Project", back_populates="workspace")
|
||||
roles = relationship("WorkspaceRole")
|
||||
|
||||
@property
|
||||
def owner(self):
|
||||
|
@@ -11,7 +11,7 @@ class WorkspaceRole(Base):
|
||||
|
||||
id = Id()
|
||||
workspace_id = Column(UUID(as_uuid=True), ForeignKey("workspaces.id"), index=True)
|
||||
workspace = relationship("Workspace")
|
||||
workspace = relationship("Workspace", back_populates="roles")
|
||||
|
||||
role_id = Column(UUID(as_uuid=True), ForeignKey("roles.id"))
|
||||
role = relationship("Role")
|
||||
|
Reference in New Issue
Block a user