func (s *Seeds) Seed() error {
	sort.Sort(s)
	for _, ss := range s.Collection {
		if ss.Name == "" {
			ss.Name = ss.ID
		}
		_ = level.Info(s.Logger).Log("msg", "seeding "+ss.Name)
		if err := ss.Run(s.Db); err != nil {
			return errors.Wrapf(err, "failed to seed %s", ss.Name)
		}
	}
	return nil
}
Seed runs all the seeds collected by the application.
package otgorm
import (
	"sort"
	"strconv"
	"github.com/go-kit/log"
	"github.com/go-kit/log/level"
	"github.com/pkg/errors"
	"gorm.io/gorm"
)
type Seed struct {
	ID string
	Name string
	Connection string
	Run func(*gorm.DB) error
}
type Seeds struct {
	Logger     log.Logger
	Db         *gorm.DB
	Collection []*Seed
}
func (s *Seeds) Len() int {
	return len(s.Collection)
}
func (s *Seeds) Less(i, j int) bool {
	ivalue, _ := strconv.ParseInt(s.Collection[i].ID, 10, 64)
	jvalue, _ := strconv.ParseInt(s.Collection[j].ID, 10, 64)
	return ivalue < jvalue
}
func (s *Seeds) Swap(i, j int) {
	s.Collection[j], s.Collection[i] = s.Collection[i], s.Collection[j]
}