Passed
Push — main ( d016cc...efa6a1 )
by Garbuz
02:33
created

CreateLgpDictTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 14
c 1
b 0
f 0
dl 0
loc 33
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
use Illuminate\Database\Migrations\Migration;
6
use Illuminate\Database\Schema\Blueprint;
7
use Illuminate\Support\Facades\Schema;
8
9
class CreateLgpDictTable extends Migration
10
{
11
    /**
12
     * Run the migrations.
13
     *
14
     * @return void
15
     */
16
    public function up()
17
    {
18
        Schema::create('lgp_dict', function(Blueprint $table) {
19
            $table->id();
20
            $table->string('name');
21
            $table->string('type')->default('select');
22
            $table->timestamps();
23
        });
24
        Schema::create('lgp_dict_option', function(Blueprint $table) {
25
            $table->id();
26
            $table->string('name');
27
            $table->text('json')->nullable();
28
            $table->integer('dict_id')->references('id')->on('lgp_dict');
29
            $table->timestamps();
30
        });
31
    }
32
33
    /**
34
     * Reverse the migrations.
35
     *
36
     * @return void
37
     */
38
    public function down()
39
    {
40
        Schema::dropIfExists('lgp_dict');
41
        Schema::dropIfExists('lgp_dict_option');
42
    }
43
}
44