code: func (m *Migrator) Exec(dir MigrationDirection, migrations ...Migration) error {
  	m.Lock()
  	defer m.Unlock()
  
  	_, err := m.db.Exec(fmt.Sprintf("CREATE TABLE IF NOT EXISTS %s (version integer primary key not null)", m.table()))
  	if err != nil {
  		return err
  	}
  
  	var tx *sql.Tx
  	if m.TransactionMode == SingleTransaction {
  		tx, err = m.db.Begin()
  		if err != nil {
  			return err
  		}
  	}
  
  	for _, migration := range sortMigrations(dir, migrations) {
  		if m.TransactionMode == IndividualTransactions {
  			tx, err = m.db.Begin()
  			if err != nil {
  				return err
  			}
  		}
  
  		if err := m.runMigration(tx, dir, migration); err != nil {
  			tx.Rollback()
  			return err
  		}
  
  		if m.TransactionMode == IndividualTransactions {
  			if err := tx.Commit(); err != nil {
  				return err
  			}
  		}
  	}
  
  	if m.TransactionMode == SingleTransaction {
  		if err := tx.Commit(); err != nil {
  			return err
  		}
  	}
  
  	return nil
  }
docs: // Exec runs the migrations in the given direction.