Completed
Push — master ( 6ea7ff...8c9744 )
by Ariel
11:07
created

CreateHumanResourcesTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 33
ccs 16
cts 16
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 15 1
A down() 0 4 1
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
class CreateHumanResourcesTable extends Migration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
7
{
8
    /**
9
     * Run the migrations.
10
     *
11
     * @return void
12
     */
13
    public function up()
14
    {
15 132
        Schema::create('humanresources', function (Blueprint $table) {
16 132
            $table->increments('id');
17 132
            $table->string('name');
18 132
            $table->string('slug', 50)->index();
19 132
            $table->integer('capacity')->unsigned()->default(1);
20 132
            $table->integer('contact_id')->unsigned()->nullable();
21 132
            $table->foreign('contact_id')->references('id')->on('contacts')->onDelete('set null');
22 132
            $table->integer('business_id')->unsigned();
23 132
            $table->foreign('business_id')->references('id')->on('businesses')->onDelete('cascade');
24 132
            $table->nullableTimestamps();
25 132
            $table->softDeletes();
26 132
        });
27 132
    }
28
29
    /**
30
     * Reverse the migrations.
31
     *
32
     * @return void
33
     */
34 1
    public function down()
35
    {
36 1
        Schema::drop('humanresources');
37 1
    }
38
}
39