Fix migration to preserve group type