CreateMenuitemsTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 39
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 21 1
A down() 0 4 1
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
class CreateMenuitemsTable extends Migration
7
{
8
    /**
9
     * Run the migrations.
10
     *
11
     * @return void
12
     */
13
    public function up()
14
    {
15
        Schema::create('menu__menuitems', function (Blueprint $table) {
16
            $table->engine = 'InnoDB';
17
            $table->increments('id');
18
            $table->integer('menu_id')->unsigned();
19
            $table->foreign('menu_id')->references('id')->on('menu__menus')->onDelete('cascade');
20
            $table->integer('page_id')->unsigned()->nullable();
21
            $table->integer('position')->unsigned()->default(0);
22
            $table->string('target', 10)->nullable();
23
            $table->string('module_name')->nullable();
24
25
            /* Nested Sets */
26
            $table->integer('parent_id')->nullable();
27
            $table->integer('lft')->nullable();
28
            $table->integer('rgt')->nullable();
29
            $table->integer('depth')->nullable();
30
31
            $table->timestamps();
32
        });
33
    }
34
35
    /**
36
     * Reverse the migrations.
37
     *
38
     * @return void
39
     */
40
    public function down()
41
    {
42
        Schema::drop('menu__menuitems');
43
    }
44
}
45