Q:

How can I write migrations to insert records using phinx?

I'm using phinx to handle the migration on a new project, now I need to create a new table and insert some rows to it, I have:
$tableStatus = $this->table('status');
$tableStatus->addColumn('code', 'string');
$tableStatus->addColumn('description', 'string');
$tableStatus->save();

This add the new table but I couldn't find at the documentation how to insert rows, but it seems possible:

The AbstractMigration Class All Phinx migrations extend from the
  AbstractMigration class. This class provides the necessary support to
  create your database migrations. Database migrations can transform
  your database in many ways such as creating new tables, inserting
  rows, adding indexes and modifying columns.

It is possible? How can I do it?

A:

As  igrossiter pointed out, there is a method for this, the name of the method is insert
use Phinx\Migration\AbstractMigration;

class NewStatus extends AbstractMigration
{
    protected $statusId = 1234; //It'd be nice to use an entity constant instead of magic numbers, but that's up to you.
    protected $statusName = 'In Progress';

    /**
    * Migrate Up.
    */
    public function up()
    {
        $columns = ['id', 'name'];
        $data = [[$this->statusId, $this->statusName]];
        $table = $this->table('status');
        $table->insert($columns, $data);
        $table->saveData();   
    }

    /**
    * Migrate Down.
    */
    public function down()
    {
        $this->execute('Delete from status where id = ' . $this->statusId);
    }
}

Edit as of December 2nd, 2015
This method's signature will change in future stable versions to something like
$data = [
    ['id' => 1, 'name' => 'foo'],
    ['id' => 2, 'name' => 'bar']
];
$table = $this->table('status');
$table->insert($data);

More info here

A:

You can do it. Read documentation for more information.
http://docs.phinx.org/en/latest/migrations.html#executing-queries
use Phinx\Migration\AbstractMigration;

class MyNewMigration extends AbstractMigration
{
    /**
    * Migrate Up.
    */
    public function up()
    {
        // execute()
        $count = $this->execute('insert into users(id, name) values (5, "john")'); 
    }

    /**
     * Migrate Down.
     */
    public function down()
    {

    }
}

