You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "Code: 500" error you're encountering is due to a SQL constraint violation identified as "[UK_UserId_RoleId_DeletedAt]". This occurs because the UserRole table has a unique constraint on the combination of UserId, RoleId, and DeletedAt. When you remove and then re-add a user's admin permissions, if the DeletedAt field is not properly updated, it can violate this unique constraint. The system likely tries to insert a new record with the same UserId and RoleId without correctly handling the DeletedAt field, leading to a conflict with the existing unique index [1].
To resolve this, you may need to ensure that the DeletedAt field is correctly managed when re-adding a user to a role they were previously removed from. This might involve updating or clearing the DeletedAt field appropriately in the database.
描述bug
简洁明了地描述一下bug
复现
通过如下步骤可以复现:
期望
截图
额外的细节和日志
The text was updated successfully, but these errors were encountered: