FIX: Do not mark badge image uploads as secure (PR #13193)

We do not need badge_image upload types to be marked as secure. Post migration is the same as FIX: Do not mark group_flair images as secure on upload by martin-brennan · Pull Request #12081 · discourse/discourse · GitHub.



maybe instead of “updated_at = security_last_changed_at” would be better to search by reason=“badge_image fixup migration”?

Is it possible that during that loop someone somehow updated_at would be changed and as the result, the image would not have updated ACL? Probably not but I feel like relying on reason would be a better match

Overall looks good, I have minor suggestion but not 100% sure about it

Either way if something updates it the reason will change too :slight_smile: I did this same thing for the other PR mentioned in the OP so I think it will be fine

actually, in that case, wouldn’t it be better to join uploads where secure is true, to just have ids that should be updated and then in later statements use only

WHERE id IN (:upload_ids) ?

Ah yes I see what you mean, will update

This pull request has been mentioned on Discourse Meta. There might be relevant details there: