CreateActivityLogTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 11
nc 1
nop 0
dl 0
loc 13
rs 9.9
c 0
b 0
f 0
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateActivityLogTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     */
12
    public function up()
13
    {
14
        Schema::connection(config('activitylog.database_connection'))->create(config('activitylog.table_name'), function (Blueprint $table) {
15
            $table->bigIncrements('id');
16
            $table->string('log_name')->nullable();
17
            $table->text('description');
18
            $table->nullableMorphs('subject', 'subject');
19
            $table->nullableMorphs('causer', 'causer');
20
            $table->json('properties')->nullable();
21
            $table->uuid('batch_uuid')->nullable();
22
            $table->string('event')->nullable();
23
            $table->timestamps();
24
            $table->index('log_name');
25
        });
26
    }
27
28
    /**
29
     * Reverse the migrations.
30
     */
31
    public function down()
32
    {
33
        Schema::connection(config('activitylog.database_connection'))->dropIfExists(config('activitylog.table_name'));
34
    }
35
}
36