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

CreateHumanResourcesTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 15
ccs 13
cts 13
cp 1
rs 9.4285
cc 1
eloc 12
nc 1
nop 0
crap 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