CreateMenuTranslationsTable::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
class CreateMenuTranslationsTable extends Migration
7
{
8
    /**
9
     * Run the migrations.
10
     *
11
     * @return void
12
     */
13
    public function up()
14
    {
15
        Schema::create('menu__menu_translations', function (Blueprint $table) {
16
            $table->engine = 'InnoDB';
17
            $table->increments('id');
18
            $table->integer('menu_id')->unsigned();
19
            $table->string('locale')->index();
20
21
            $table->tinyInteger('status')->default(0);
22
            $table->string('title');
23
24
            $table->unique(['menu_id', 'locale']);
25
            $table->foreign('menu_id')->references('id')->on('menu__menus')->onDelete('cascade');
26
            $table->timestamps();
27
        });
28
    }
29
30
    /**
31
     * Reverse the migrations.
32
     *
33
     * @return void
34
     */
35
    public function down()
36
    {
37
        Schema::drop('menu__menu_translations');
38
    }
39
}
40