php-censor/src/Migrations/20170420142131_added_tag_column_to_build_table.php
2018-03-09 13:46:18 +07:00

29 lines
577 B
PHP

<?php
use Phinx\Migration\AbstractMigration;
class AddedTagColumnToBuildTable extends AbstractMigration
{
public function up()
{
$table = $this->table('build');
if (!$table->hasColumn('tag')) {
$table
->addColumn('tag', 'string', ['limit' => 250, 'null' => true])
->save();
}
}
public function down()
{
$table = $this->table('build');
if ($table->hasColumn('tag')) {
$table
->removeColumn('tag')
->save();
}
}
}