This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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