User flair remains after user is removed from group

Dear @vinothkannans, we’re upgraded discourse version & ran the query you provided:

[1] pry(main)> User.joins("LEFT OUTER JOIN group_users ON group_users.user_id = users.id AND group_users.group_id = users.flair_group_id").where(group_users: { id: nil }).where.not(flair_group_id: nil).update_all(flair_group_id: nil)
=> 370
[2] pry(main)> 

I see user flairs changed according to their group status. Thank you again for prompt assistance!

4 Likes