Passed
Push — main ( d04005...d016cc )
by Garbuz
02:22
created

CreateLgpDictTable::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
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
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
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