-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Include OriginalAuthor in Reaction constraint #13505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our < 8000 a class="Link--inTextBlock" href="https://docs.github.com/terms" target="_blank">terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include OriginalAuthor in Reaction constraint #13505
Conversation
When migrating repositories with reactions with deleted users, the original author id may be -1. This means that it is possible to end up attempting to create multiple reactions with the same [ Type, IssueID, CommentID, UserID, OriginalAuthorID ] thus breaking the constraints. On SQLite this appears to cause a deadlock but on other dbs this will cause the migration to fail. This PR extends the constraint to include the original author username in the constraint. Fix go-gitea#13271 Signed-off-by: Andrew Thornton <art27@cantab.net>
ok migration cant be backported ... I'll file a pull to drop entrys from API witch wont have any chance to get migrated to an existing user somehow |
The backport would just have to drop the reactions if they have originalauthorid -1 I think |
admittedly such a backport would not be a backport just an alternate fix but it's the only solution. |
Signed-off-by: Andrew Thornton <art27@cantab.net>
…' of github.com:zeripath/gitea into fix-13271-move-original-author-into-reaction-constraint
damn recreateTable has to be in a transaction for MSSQL - just put it in one |
Codecov Report
Continue to review full report at Codecov.
|
potential issue from this -> #13588 |
No this is not the cause of your issue. |
When migrating repositories with reactions with deleted users, the original
author id may be -1. This means that it is possible to end up attempting
to create multiple reactions with the same [ Type, IssueID, CommentID, UserID,
OriginalAuthorID ] thus breaking the constraints.
On SQLite this appears to cause a deadlock but on other dbs this will
cause the migration to fail.
This PR extends the constraint to include the original author username
in the constraint.
Fix #13271
Signed-off-by: Andrew Thornton art27@cantab.net