Passed
Push — main ( ec0923...4d334c )
by Seth
01:22
created

2023_01_28_154030_create_files_table.php$0 ➔ up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 41
Code Lines 32

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 32
nc 1
nop 0
dl 0
loc 41
rs 9.408
c 1
b 0
f 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
return new class () extends Migration {
8
    public function up()
9
    {
10
        Schema::create('files', function (Blueprint $table) {
11
            $table->id();
12
            $table->uuid()->unique();
13
            $table->nullableMorphs('model');
14
15
            $table->string('category')->nullable();
16
            $table->string('filename');
17
            $table->string('path');
18
            $table->string('original_filename');
19
            $table->string('mime_type');
20
            $table->unsignedBigInteger('size');
21
            $table->string('source')->nullable();
22
23
            $table->timestamps();
24
            $table->softDeletes();
25
26
            $table->index([
27
                'id',
28
                'deleted_at',
29
            ], 'idx_files_find_by_id');
30
31
            $table->index([
32
                'uuid',
33
                'deleted_at',
34
            ], 'idx_files_find_by_uuid');
35
36
            // normal search
37
            $table->index([
38
                'model_id',
39
                'model_type',
40
                'deleted_at',
41
            ], 'idx_files_normal_search');
42
43
            $table->index([
44
                'model_id',
45
                'model_type',
46
                'category',
47
                'deleted_at',
48
            ], 'idx_files_category_search');
49
        });
50
    }
51
};
52