Fixed environment field in build table

This commit is contained in:
Dmitry Khomutov 2017-04-16 20:09:33 +07:00
parent 1f9ec69c52
commit c752651d10
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9

View file

@ -0,0 +1,28 @@
<?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();
}
}
}