Add grouping model and migrate