Passed
Push — master ( 522ba7...dac3f8 )
by Andrey
13:44
created

CreateUserPermissionTable::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
1
<?php
2
3
use Helldar\Roles\Support\Database\BaseMigration;
4
5
class CreateUserPermissionTable extends BaseMigration
6
{
7
    public function up()
8
    {
9
        $this->createPivot($this->user_permission, $this->users, $this->permissions, 'user_id', 'permission_id');
10
    }
11
12
    public function down()
13
    {
14
        $this->schema()->disableForeignKeyConstraints();
15
16
        $this->dropTables($this->user_permission);
17
18
        $this->schema()->enableForeignKeyConstraints();
19
    }
20
}
21