Passed
Push — master ( 3d397a...3f0190 )
by Andrey
12:15
created

ModifyRolesTableAddIsRootColumn::schema()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
5
class ModifyRolesTableAddIsRootColumn extends BaseMigration
6
{
7
    public function up()
8
    {
9
        $this->table($this->roles, function (Blueprint $table) {
10
            $table->boolean('is_root')->default(false)->after('name');
11
        });
12
    }
13
14
    public function down()
15
    {
16
        $this->table($this->roles, function (Blueprint $table) {
17
            $table->dropColumn('is_root');
18
        });
19
    }
20
}
21