diff --git a/cmd/migrate/danke_v3.go b/cmd/migrate/danke_v3.go index b0ec373..68760e4 100644 --- a/cmd/migrate/danke_v3.go +++ b/cmd/migrate/danke_v3.go @@ -239,10 +239,13 @@ where true`).Error } // update course_group.course_count, course_group.credits - err = tx.Exec(`update course_group -set course_count = (select count(*) from course where course.course_group_id = course_group.id) - credits = (select concat('[', group_concat(distinct credit), ']') from course group by course_group_id); + err = tx.Exec(`update course_group +set course_count = (select count(*) from course where course.course_group_id = course_group.id), + credits = (select concat('[', group_concat(distinct credit), ']') from course where course_group_id = course_group.id) where true`).Error + if err != nil { + return err + } if m.HasColumn(&model.Review{}, "upvoters") { err = m.DropColumn(&model.Review{}, "upvoters")