FIX: Set user flair group to primary group (#13718)

This is a follow up to commit 87c1e98571
which introduced different fields for primary and flair groups. Before
that, primary group was used as a flair group too.
This commit is contained in:
Bianca Nenciu 2021-07-13 12:52:41 +03:00 committed by GitHub
parent 21cf1b78da
commit 4ba93aac66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,11 @@
# frozen_string_literal: true
class SetUsersFlairGroupId < ActiveRecord::Migration[6.1]
def change
execute <<~SQL
UPDATE users
SET flair_group_id = primary_group_id
WHERE flair_group_id IS NULL
SQL
end
end