Added new errors label in build "Errors" tab.

This commit is contained in:
Dmitry Khomutov 2017-12-09 22:04:34 +07:00
commit 13f763c9e2
No known key found for this signature in database
GPG key ID: EC19426474B37AAC
9 changed files with 186 additions and 18 deletions

View file

@ -0,0 +1,44 @@
<?php
use Phinx\Migration\AbstractMigration;
class AddedNewLabelForErrors extends AbstractMigration
{
public function up()
{
if ($this->hasTable('build_error')) {
$table = $this->table('build_error');
if (!$table->hasColumn('hash')) {
$table
->addColumn('hash', 'string', ['limit' => 32, 'default' => ''])
->save();
}
if (!$table->hasColumn('is_new')) {
$table
->addColumn('is_new', 'boolean', ['default' => false])
->save();
}
}
}
public function down()
{
if ($this->hasTable('build_error')) {
$table = $this->table('build_error');
if ($table->hasColumn('hash')) {
$table
->removeColumn('hash')
->save();
}
if ($table->hasColumn('is_new')) {
$table
->removeColumn('is_new')
->save();
}
}
}
}