Completed
Push — master ( 373282...ca23d3 )
by Antonio Carlos
24:07 queued 18:44
created

CreateTrackerLogTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 49
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
B migrateUp() 0 24 1
A migrateDown() 0 4 1
1
<?php
2
3
use PragmaRX\Tracker\Support\Migration;
4
5
class CreateTrackerLogTable 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...
6
{
7
    /**
8
     * Table related to this migration.
9
     *
10
     * @var string
11
     */
12
    private $table = 'tracker_log';
13
14
    /**
15
     * Run the migrations.
16
     *
17
     * @return void
18
     */
19
    public function migrateUp()
20
    {
21
        $this->builder->create(
22
            $this->table,
23
            function ($table) {
24
                $table->bigIncrements('id');
25
26
                $table->bigInteger('session_id')->unsigned()->index();
27
                $table->bigInteger('path_id')->unsigned()->nullable()->index();
28
                $table->bigInteger('query_id')->unsigned()->nullable()->index();
29
                $table->string('method', 10)->index();
30
                $table->bigInteger('route_path_id')->unsigned()->nullable()->index();
31
                $table->boolean('is_ajax');
32
                $table->boolean('is_secure');
33
                $table->boolean('is_json');
34
                $table->boolean('wants_json');
35
                $table->bigInteger('error_id')->unsigned()->nullable()->index();
36
37
                $table->timestamps();
38
                $table->index('created_at');
39
                $table->index('updated_at');
40
            }
41
        );
42
    }
43
44
    /**
45
     * Reverse the migrations.
46
     *
47
     * @return void
48
     */
49
    public function migrateDown()
50
    {
51
        $this->drop($this->table);
52
    }
53
}
54