ChangeDescriptionField   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 8 2
A down() 0 8 2
1
<?php
2
3
namespace GinoPane\BlogTaxonomy\Updates;
4
5
use Schema;
6
use GinoPane\BlogTaxonomy\Models\Series;
7
use October\Rain\Database\Updates\Migration;
8
9
/**
10
 * Class ChangeDescriptionField
11
 *
12
 * @package GinoPane\BlogTaxonomy\Updates
13
 */
14
class ChangeDescriptionField extends Migration
15
{
16
    /**
17
     * Execute migrations
18
     */
19
    public function up()
20
    {
21
        if (Schema::hasTable(Series::TABLE_NAME)) {
22
            Schema::table(Series::TABLE_NAME, static function ($table) {
23
                $table->text('description')->nullable()->change();
24
            });
25
        }
26
    }
27
28
    /**
29
     * Rollback migrations
30
     */
31
    public function down()
32
    {
33
        if (Schema::hasTable(Series::TABLE_NAME)) {
34
            Schema::table(Series::TABLE_NAME, static function ($table) {
35
                $table->string('description')->nullable()->change();
36
            });
37
        }
38
    }
39
}
40