Completed
Push — master ( 394510...c62883 )
by Nicolas
19:53 queued 15:41
created

CreateRevisionsTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 11

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 15
rs 9.4286
cc 1
eloc 11
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
class CreateRevisionsTable extends Migration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
7
{
8
    /**
9
     * Run the migrations.
10
     *
11
     * @return void
12
     */
13
    public function up()
14
    {
15
        Schema::create('revisions', function (Blueprint $table) {
16
            $table->increments('id');
17
            $table->string('revisionable_type');
18
            $table->integer('revisionable_id');
19
            $table->integer('user_id')->nullable();
20
            $table->string('key');
21
            $table->text('old_value')->nullable();
22
            $table->text('new_value')->nullable();
23
            $table->timestamps();
24
25
            $table->index(array('revisionable_id', 'revisionable_type'));
26
        });
27
    }
28
29
    /**
30
     * Reverse the migrations.
31
     *
32
     * @return void
33
     */
34
    public function down()
35
    {
36
        Schema::drop('revisions');
37
    }
38
}
39