Completed
Push — dev5 ( f3ede3...502bc5 )
by Ron
08:16
created

CreateUserPermissionsTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 14
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 16
rs 9.7998
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class CreateUserPermissionsTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('user_permissions', function (Blueprint $table) {
17
            $table->increments('user_id')->unsigned();
18
            $table->boolean('manage_users')->default(0);
19
            $table->boolean('run_reports')->default(0);
20
            $table->boolean('add_customer')->default(1);
21
            $table->boolean('deactivate_customer')->default(0);
22
            $table->boolean('use_file_links')->default(1);
23
            $table->boolean('create_tech_tip')->default(1);
24
            $table->boolean('edit_tech_tip')->default(0);
25
            $table->boolean('delete_tech_tip')->default(0);
26
            $table->boolean('create_category')->default(0);
27
            $table->boolean('modify_category')->default(0);
28
            $table->foreign('user_id')->references('user_id')->on('users')->onUpdate('cascade')->onDelete('cascade');
29
            $table->timestamps();
30
        });
31
    }
32
33
    /**
34
     * Reverse the migrations.
35
     *
36
     * @return void
37
     */
38
    public function down()
39
    {
40
        Schema::dropIfExists('user_permissions');
41
    }
42
}
43