package updates import ( "strings" "gorm.io/gorm" ) // execAll runs each semicolon-separated statement of sql in order. The // statements hold no semicolons of their own. func execAll(tx *gorm.DB, sql string) error { for _, stmt := range strings.Split(sql, ";") { if strings.TrimSpace(stmt) == "" { continue } if err := tx.Exec(stmt).Error; err != nil { return err } } return nil }