Skip to content

Instantly share code, notes, and snippets.

@robmorgan
Created April 6, 2013 05:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robmorgan/5325000 to your computer and use it in GitHub Desktop.
Save robmorgan/5325000 to your computer and use it in GitHub Desktop.
<?php
use Phinx\Migration\AbstractMigration;
class ExampleMigration extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
*
* Uncomment this method if you would like to use it.
*/
public function change()
{
$table = $this->table('posts');
$table->addColumn('title', 'string', array('limit' => 30))
->addColumn('body', 'text')
->addColumn('created', 'datetime')
->addColumn('updated', 'datetime', array('default' => null))
->create();
}
/**
* Migrate Up.
*/
public function up()
{
}
/**
* Migrate Down.
*/
public function down()
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment