CreatePropertyBagTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 11
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
6
class CreatePropertyBagTable extends Migration
7
{
8
    /**
9
     * Run the migrations.
10
     *
11
     * @return void
12
     */
13
    public function up()
14
    {
15
        Schema::create('property_bag', function (Blueprint $table) {
16
            $table->increments('id');
17
            $table->string('resource_type')->index();
18
            $table->integer('resource_id')->unsigned()->index();
19
            $table->string('key')->index();
20
            $table->text('value');
21
            $table->timestamps();
22
23
            $table->unique(['resource_type', 'resource_id', 'key']);
24
        });
25
    }
26
27
    /**
28
     * Reverse the migrations.
29
     *
30
     * @return void
31
     */
32
    public function down()
33
    {
34
        Schema::drop('property_bag');
35
    }
36
}
37