code: func (m Migrator) Down(step int) error {
  	c := m.Connection
  	return m.exec(func() error {
  		mtn := c.MigrationTableName()
  		count, err := c.Count(mtn)
  		if err != nil {
  			return errors.Wrap(err, "migration down: unable count existing migration")
  		}
  		mfs := m.Migrations["down"]
  		sort.Sort(sort.Reverse(mfs))
  		// skip all runned migration
  		if len(mfs) > count {
  			mfs = mfs[len(mfs)-count:]
  		}
  		// run only required steps
  		if step > 0 && len(mfs) >= step {
  			mfs = mfs[:step]
  		}
  		for _, mi := range mfs {
  			exists, err := c.Where("version = ?", mi.Version).Exists(mtn)
  			if err != nil || !exists {
  				return errors.Wrapf(err, "problem checking for migration version %s", mi.Version)
  			}
  			err = c.Transaction(func(tx *Connection) error {
  				err := mi.Run(tx)
  				if err != nil {
  					return err
  				}
  				err = tx.RawQuery(fmt.Sprintf("delete from %s where version = ?", mtn), mi.Version).Exec()
  				return errors.Wrapf(err, "problem deleting migration version %s", mi.Version)
  			})
  			if err != nil {
  				return err
  			}
  
  			log(logging.Info, "< %s", mi.Name)
  		}
  		return nil
  	})
  }
docs: // Down runs pending "down" migrations and rolls back the
  // database by the specified number of steps.