Skip to content

Instantly share code, notes, and snippets.

@robmorgan
Created October 13, 2012 04:43
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/3883258 to your computer and use it in GitHub Desktop.
Save robmorgan/3883258 to your computer and use it in GitHub Desktop.
<?php
use Phinx\Migration\AbstractMigration;
class CreatePostsTable extends AbstractMigration
{
/**
* Migrate Up.
*/
public function up()
{
$posts = $this->table('posts');
$posts->addColumn('title', 'string', array('limit' => 40))
->addColumn('body', 'text')
->addColumn('created', 'datetime')
->save();
}
/**
* Migrate Down.
*/
public function down()
{
$this->dropTable('posts');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment