update
parent
5c8b5c20d6
commit
4cb2bad653
|
@ -44,9 +44,11 @@ func ChangeCalGroup(tx *gorm.DB, cal_id, to string) error {
|
|||
if affected == 0 {
|
||||
return errors.ErrorNotFound
|
||||
}
|
||||
tx.Exec(`update events set group_id = (
|
||||
tx.Exec(`update event_groups set group_id = (
|
||||
select id from groups where name = ?
|
||||
) where calendar_id = ?`, to, cal_id)
|
||||
) where id in (
|
||||
select event_group_id from events where calendar_id = ?
|
||||
)`, to, cal_id)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue