Passed
Push — master ( b001ec...8093a0 )
by Johnny
02:57
created

CreateVisitorsTable::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
0 ignored issues
show
Bug introduced by
The type Illuminate\Database\Migrations\Migration was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
4
use Illuminate\Database\Schema\Blueprint;
0 ignored issues
show
Bug introduced by
The type Illuminate\Database\Schema\Blueprint was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
5
use Illuminate\Support\Facades\Schema;
0 ignored issues
show
Bug introduced by
The type Illuminate\Support\Facades\Schema was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
class CreateVisitorsTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('visitors', function (Blueprint $table) {
17
            $table->increments('id');
18
            $table->string('unique_id');
19
20
            $table->unsignedInteger('user_id')->nullable();
21
            $table->string('ip', 40);
22
23
            $table->string('user_agent')->nullable();
24
            $table->boolean('is_desktop')->default(false);
25
            $table->boolean('is_mobile')->default(false);
26
            $table->boolean('is_bot')->default(false);
27
            $table->string('bot')->nullable();
28
            $table->string('os')->default('');
29
            $table->string('browser_version')->default('');
30
            $table->string('browser')->default('');
31
32
            $table->string('country')->default('');
33
            $table->string('country_code')->default('');
34
            $table->string('city')->default('');
35
            $table->double('lat')->nullable();
36
            $table->double('long')->nullable();
37
38
            $table->string('browser_language_family', 4)->default('');
39
            $table->string('browser_language', 7)->default('');
40
41
            $table->timestamps();
42
        });
43
    }
44
45
    /**
46
     * Reverse the migrations.
47
     *
48
     * @return void
49
     */
50
    public function down()
51
    {
52
        Schema::dropIfExists('visitors');
53
    }
54
}
55