Passed
Push — master ( c36ed8...8867a0 )
by Quentin
13:25 queued 05:48
created

CreateFeaturesTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 2
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateFeaturesTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('features', function (Blueprint $table) {
17
            $table->increments('id');
18
            $table->string('featured_id', 36);
19
            $table->string('featured_type', 255);
20
            $table->string('bucket_key')->index();
21
            $table->integer('position')->unsigned();
22
            $table->boolean('starred')->default(false);
23
            $table->timestamps();
24
            $table->unique(['featured_id', 'featured_type', 'bucket_key'], 'features_unique');
25
        });
26
    }
27
28
    /**
29
     * Reverse the migrations.
30
     *
31
     * @return void
32
     */
33
    public function down()
34
    {
35
        Schema::dropIfExists('features');
36
    }
37
}
38