Commits

Marcin Kuzminski  committed 3fbc09a

fixes issues #202, bad db constraint made impossible to attach same group more than one time.
Affects only mysql/postgres

  • Participants
  • Parent commits f955967
  • Branches beta

Comments (0)

Files changed (1)

File rhodecode/model/db.py

 
 class UsersGroupRepoToPerm(Base):
     __tablename__ = 'users_group_repo_to_perm'
-    __table_args__ = (UniqueConstraint('users_group_id', 'permission_id'), {'extend_existing':True})
+    __table_args__ = (UniqueConstraint('repository_id', 'users_group_id', 'permission_id'), {'extend_existing':True})
     users_group_to_perm_id = Column("users_group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
     users_group_id = Column("users_group_id", Integer(), ForeignKey('users_groups.users_group_id'), nullable=False, unique=None, default=None)
     permission_id = Column("permission_id", Integer(), ForeignKey('permissions.permission_id'), nullable=False, unique=None, default=None)