Migrate old issues without author to the ghost user
What does this MR do?
It migrates all issues that have either author_id = nil
or whose author_id
points to non existing record in the users table to the ghost user.
Additionally it simplifies the conditions that were hotfixed in !13807 (merged) - we don't need the author presence check anymore.
Are there points in the code the reviewer needs to double check?
Not sure there is a way how to simplify fetching/creating the ghost user and still be safe...
Why was this MR needed?
We now have dependent: destroy
for issues - author association. That wasn't always the case and some records could end up with references to non existing users (deleted records). We need to migrate all these records to the ghost user.
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together
What are the relevant issue numbers?
Closes #36860 (closed)
Edited by Yorick Peterse