CreateMenuitemsTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 15

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 21
rs 9.3143
cc 1
eloc 15
nc 1
nop 0
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