Added new errors label in build "Errors" tab.
This commit is contained in:
parent
1b65b02fa6
commit
13f763c9e2
9 changed files with 186 additions and 18 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue