CreateFilesTable::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
6
class CreateFilesTable extends Migration
7
{
8
    /**
9
     * Run the migrations.
10
     *
11
     * @return void
12
     */
13
    public function up()
14
    {
15
        Schema::create('files', function (Blueprint $table) {
16
            $table->engine = 'InnoDb';
17
            $table->string('hash', 64)->primary();
18
            $table->string('disk', 64)->default('localhost');
19
            $table->string('path', 1024);
20
            $table->string('mime', 255);
21
            $table->bigInteger('size');
22
            $table->text('metadata');
23
            $table->timestamps();
24
        });
25
    }
26
27
    /**
28
     * Reverse the migrations.
29
     *
30
     * @return void
31
     */
32
    public function down()
33
    {
34
        Schema::drop('files');
35
    }
36
}
37