php-censor/src/Migrations/20140611170618_choose_branch.php

25 lines
531 B
PHP
Raw Permalink Normal View History

2014-06-11 15:18:31 +02:00
<?php
use Phinx\Migration\AbstractMigration;
class ChooseBranch extends AbstractMigration
{
public function up()
{
$project = $this->table('project');
2016-05-07 08:43:21 +02:00
2016-05-05 18:33:12 +02:00
if (!$project->hasColumn('branch')) {
$project->addColumn('branch', 'string', ['after' => 'reference', 'limit' => 250])->save();
}
2014-06-11 15:18:31 +02:00
}
public function down()
{
$project = $this->table('project');
2016-05-07 08:43:21 +02:00
2016-05-05 18:33:12 +02:00
if ($project->hasColumn('branch')) {
$project->removeColumn('branch')->save();
}
2014-06-11 15:18:31 +02:00
}
2015-02-12 15:11:58 +01:00
}