Skip to content

Commit

Permalink
chore: Fix Groups/UserGroupsAssociation table overlap issue (#847)
Browse files Browse the repository at this point in the history
Fix overlap issue
  • Loading branch information
tianjing-li authored Nov 19, 2024
1 parent 8fd8cf1 commit ad8363c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/backend/database_models/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ class Group(Base):
display_name: Mapped[str] = mapped_column(String)

users = relationship("User", secondary="user_group", backref="groups")
user_associations = relationship("UserGroupAssociation", back_populates="group")
user_associations = relationship("UserGroupAssociation", back_populates="group", overlaps="groups,users")

__table_args__ = (UniqueConstraint("display_name", name="unique_display_name"),)
2 changes: 1 addition & 1 deletion src/backend/database_models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class UserGroupAssociation(Base):
)
display: Mapped[str] = mapped_column()

group = relationship("Group", back_populates="user_associations")
group = relationship("Group", back_populates="user_associations", overlaps="groups,user_associations,users")


class User(Base):
Expand Down

0 comments on commit ad8363c

Please sign in to comment.