code: func (m *Migrator) runMigration(tx *sql.Tx, dir MigrationDirection, migration Migration) error {
  	shouldMigrate, err := m.shouldMigrate(tx, migration.ID, dir)
  	if err != nil {
  		return err
  	}
  
  	if !shouldMigrate {
  		return nil
  	}
  
  	var migrate func(tx *sql.Tx) error
  	switch dir {
  	case Up:
  		migrate = migration.Up
  	default:
  		migrate = migration.Down
  	}
  
  	if err := migrate(tx); err != nil {
  		return &MigrationError{Migration: migration, Err: err}
  	}
  
  	var query string
  	switch dir {
  	case Up:
  		// Yes. This is a sql injection vulnerability. This gets around
  		// the different bindings for sqlite3/postgres.
  		//
  		// If you're running migrations from user input, you're doing
  		// something wrong.
  		query = fmt.Sprintf("INSERT INTO %s (version) VALUES (%d)", m.table(), migration.ID)
  	default:
  		query = fmt.Sprintf("DELETE FROM %s WHERE version = %d", m.table(), migration.ID)
  	}
  
  	_, err = tx.Exec(query)
  	return err
  }
docs: // runMigration runs the given Migration in the given direction using the given
  // transaction. This function does not commit or rollback the transaction,
  // that's the responsibility of the consumer dependending on whether an error
  // gets returned.