Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.