Passed
Push — master ( c36ed8...8867a0 )
by Quentin
13:25 queued 05:48
created

CreateTwillActivityLogTable   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 30
rs 10
wmc 3
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateTwillActivityLogTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     */
12
    public function up()
13
    {
14
        if (!Schema::hasTable(config('activitylog.table_name'))) {
15
            Schema::create(config('activitylog.table_name'), function (Blueprint $table) {
16
                $table->increments('id');
17
                $table->string('log_name')->nullable();
18
                $table->text('description');
19
                $table->integer('subject_id')->nullable();
20
                $table->string('subject_type')->nullable();
21
                $table->integer('causer_id')->nullable();
22
                $table->string('causer_type')->nullable();
23
                $table->text('properties')->nullable();
24
                $table->timestamps();
25
26
                $table->index('log_name');
27
            });
28
        }
29
    }
30
31
    /**
32
     * Reverse the migrations.
33
     */
34
    public function down()
35
    {
36
        Schema::dropIfExists(config('activitylog.table_name'));
37
    }
38
}
39