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

29 lines
626 B
PHP

<?php
use Phinx\Migration\AbstractMigration;
class AddedDefaultBranchOnly extends AbstractMigration
{
public function up()
{
$table = $this->table('project');
if (!$table->hasColumn('default_branch_only')) {
$table
->addColumn('default_branch_only', 'integer', ['default' => 0])
->save();
}
}
public function down()
{
$table = $this->table('project');
if ($table->hasColumn('default_branch_only')) {
$table
->removeColumn('default_branch_only')
->save();
}
}
}