Skip to content

Migrate old issues without author to the ghost user

Jarka Kadlecova requested to merge 36860-migrate-issues-author into master

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?

What are the relevant issue numbers?

Closes #36860 (closed)

Edited by yorickpeterse-staging

Merge request reports