CreateModelLogsTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
dl 0
loc 38
ccs 18
cts 21
cp 0.8571
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 20 1
A down() 0 4 1
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateModelLogsTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14 14
    public function up()
15
    {
16
        Schema::create('model_logs', function (Blueprint $table) {
17 14
            $table->increments('id');
18 14
            $table->morphs('subject');
19 14
            $table->string('causer_type')->nullable();
20 14
            $table->integer('causer_id')->nullable();
21 14
            $table->string('description');
22 14
            $table->string('action');
23 14
            $table->json('old')->nullable();
24 14
            $table->json('new');
25 14
            $table->string('route')->nullable();
26 14
            $table->string('reverter_type')->nullable();
27 14
            $table->string('reverter_id')->nullable();
28 14
            $table->timestamp('reverted_at')->nullable();
29 14
            $table->string('revert_note')->nullable();
30 14
            $table->softDeletes();
31 14
            $table->timestamps();
32 14
        });
33 14
    }
34
35
    /**
36
     * Reverse the migrations.
37
     *
38
     * @return void
39
     */
40
    public function down()
41
    {
42
        Schema::dropIfExists('model_logs');
43
    }
44
}
45