CreateContentTypeTextsTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 10
nc 1
nop 0
dl 0
loc 12
rs 9.9332
c 1
b 0
f 0
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class CreateContentTypeTextsTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     */
12
    public function up()
13
    {
14
        Schema::create('content_type_texts', function (Blueprint $table) {
15
            $table->bigIncrements('id');
16
            $table->nullableMorphs('linkable');
17
            $table->string('locale', 5);
18
            $table->string('group', 75)->nullable();
19
            $table->string('key', 75)->nullable();
20
            $table->longText('value')->nullable();
21
            $table->timestamps();
22
            $table->softDeletes();
23
            $table->unique(['linkable_type', 'linkable_id', 'locale', 'group', 'key']);
24
        });
25
    }
26
27
    /**
28
     * Reverse the migrations.
29
     */
30
    public function down()
31
    {
32
        Schema::dropIfExists('content_type_texts');
33
    }
34
}
35