php-censor/src/Migrations/20170416130610_fixed_environments.php

29 lines
647 B
PHP
Raw Permalink Normal View History

2017-04-16 15:09:33 +02:00
<?php
use Phinx\Migration\AbstractMigration;
class FixedEnvironments extends AbstractMigration
{
public function up()
{
$table = $this->table('build');
if ($table->hasColumn('environment')) {
$table
->changeColumn('environment', 'string', ['limit' => 250, 'null' => true])
->save();
}
}
public function down()
{
$table = $this->table('build');
if ($table->hasColumn('environment')) {
$table
->changeColumn('environment', 'string', ['limit' => 250, 'null' => false])
->save();
}
}
}