From 4ba93aac667f8e50ffb63635bb4e42ff34dcd58e Mon Sep 17 00:00:00 2001 From: Bianca Nenciu Date: Tue, 13 Jul 2021 12:52:41 +0300 Subject: [PATCH] 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. --- db/migrate/20210713092503_set_users_flair_group_id.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 db/migrate/20210713092503_set_users_flair_group_id.rb 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 00000000000..fdcd573a902 --- /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