FIX: Store user_accuracy_bonus to clarify explanations (PR #8165)

GitHub

You’ve signed the CLA, markvanlan. Thank you! This pull request is ready for review.

The ALTER part should use rails helpers to be consistent with our other migrations.

Looks good so far!

I tend to prefer an UPDATE with a JOIN for this kind of thing rather than a correlated subquery. However, there probably aren’t many scores in most databases so maybe it doesn’t matter?

I made a small comment about NULL but otherwise I think it’s good to merge when ready!

Very minor but I’d add a null: false here to make sure the column is not nullable.