CreateBinaryUsersTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 2
eloc 10
c 2
b 1
f 0
dl 0
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 10 1
A down() 0 3 1
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateBinaryUsersTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     */
12
    public function up()
13
    {
14
        Schema::create('binary_users', function (Blueprint $table) {
15
            $table->binary('user_id');
16
            $table->unsignedInteger('organization_id');
17
            $table->primary(['user_id', 'organization_id']);
18
            $table->unsignedInteger('role_id');
19
            $table->binary('binary_role_id')->nullable();
20
            $table->string('name')->unique();
21
            $table->unsignedInteger('counter')->default(0);
22
        });
23
    }
24
25
    /**
26
     * Reverse the migrations.
27
     */
28
    public function down()
29
    {
30
        Schema::drop('binary_users');
31
    }
32
}
33