CreateMediaTable::down()   A
last analyzed

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
nc 1
nop 0
dl 0
loc 3
c 1
b 0
f 0
cc 1
rs 10
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class CreateMediaTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('media', function (Blueprint $table) {
17
            $table->increments('id');
18
            $table->string('stored_name');
19
            $table->string('file_name');
20
            $table->string('extension', 5);
21
            $table->string('caption')->nullable();
22
            $table->string('mime', 30);
23
            $table->integer('size');
24
            $table->integer('width')->nullable();
25
            $table->integer('height')->nullable();
26
            $table->integer('mediumable_id')->nullable();
27
            $table->string('mediumable_type')->nullable();
28
            $table->tinyInteger('position')->nullable();
29
            $table->string('manner')->nullable();
30
            $table->integer('comments_count')->default(0);
31
            $table->integer('likes_count')->default(0);
32
            $table->string('description')->nullable();
33
            $table->timestamps();
34
        });
35
    }
36
37
    /**
38
     * Reverse the migrations.
39
     *
40
     * @return void
41
     */
42
    public function down()
43
    {
44
        Schema::dropIfExists('media');
45
    }
46
}
47