Completed
Pull Request — master (#23)
by ARCANEDEV
08:07
created

CreateAuthRoleUserPivotTable::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
use Arcanedev\LaravelAuth\Bases\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
/**
7
 * Class     CreateRoleUserTable
8
 *
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class CreateAuthRoleUserPivotTable extends Migration
12
{
13
    /* -----------------------------------------------------------------
14
     |  Constructor
15
     | -----------------------------------------------------------------
16
     */
17
    /**
18
     * CreateAuthRoleUserPivotTable constructor.
19
     */
20
    public function __construct()
21
    {
22
        parent::__construct();
23
24
        $this->setTable('role_user');
25
    }
26
27
    /* -----------------------------------------------------------------
28
     |  Main Methods
29
     | -----------------------------------------------------------------
30
     */
31
    /**
32
     * Run the migrations.
33
     */
34
    public function up()
35
    {
36
        $this->createSchema(function (Blueprint $table) {
37
            $table->unsignedInteger('role_id');
38
            $table->unsignedInteger('user_id');
39
            $table->timestamps();
40
41
            $table->primary(['user_id', 'role_id']);
42
        });
43
    }
44
}
45