code: func (m Migrator) Up() error {
  	c := m.Connection
  	return m.exec(func() error {
  		mtn := c.MigrationTableName()
  		mfs := m.Migrations["up"]
  		sort.Sort(mfs)
  		applied := 0
  		for _, mi := range mfs {
  			if mi.DBType != "all" && mi.DBType != c.Dialect.Name() {
  				// Skip migration for non-matching dialect
  				continue
  			}
  			exists, err := c.Where("version = ?", mi.Version).Exists(mtn)
  			if err != nil {
  				return errors.Wrapf(err, "problem checking for migration version %s", mi.Version)
  			}
  			if exists {
  				continue
  			}
  			err = c.Transaction(func(tx *Connection) error {
  				err := mi.Run(tx)
  				if err != nil {
  					return err
  				}
  				_, err = tx.Store.Exec(fmt.Sprintf("insert into %s (version) values ('%s')", mtn, mi.Version))
  				return errors.Wrapf(err, "problem inserting migration version %s", mi.Version)
  			})
  			if err != nil {
  				return errors.WithStack(err)
  			}
  			log(logging.Info, "> %s", mi.Name)
  			applied++
  		}
  		if applied == 0 {
  			log(logging.Info, "Migrations already up to date, nothing to apply")
  		}
  		return nil
  	})
  }
docs: // Up runs pending "up" migrations and applies them to the database.