CreateNestedEntities::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
6
class CreateNestedEntities extends Migration
7
{
8
    /**
9
     * Run the migrations.
10
     *
11
     * @return void
12
     */
13
    public function up()
14
    {
15
        Schema::create('nested_entities', function (Blueprint $table) {
16
            $table->engine = 'InnoDb';
17
18
            $table->mediumInteger('id', true, true);
19
            $table->string('name', 255);
20
            $table->mediumInteger('left_range', false, true);
21
            $table->mediumInteger('right_range', false, true);
22
            $table->timestamps();
23
            $table->softDeletes();
24
25
            $table->unique(array('left_range', 'right_range'));
26
        });
27
    }
28
29
    /**
30
     * Reverse the migrations.
31
     *
32
     * @return void
33
     */
34
    public function down()
35
    {
36
        Schema::drop('nested_entities');
37
    }
38
}
39