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

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

This is a follow up to commit 87c1e98571631d83e0d9f0846bd95a2c7e9bce87 which introduced different fields for primary and flair groups. Before that, primary group was used as a flair group too.

diff --git a/db/migrate/20210713092503_set_users_flair_group_id.rb b/db/migrate/20210713092503_set_users_flair_group_id.rb
new file mode 100644
index 0000000..fdcd573
--- /dev/null
+++ b/db/migrate/20210713092503_set_users_flair_group_id.rb
@@ -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

GitHub sha: 4ba93aac667f8e50ffb63635bb4e42ff34dcd58e

This commit appears in #13718 which was approved by ZogStriP. It was merged by nbianca.