Completed
Push — master ( fec5d0...4661c4 )
by Joao
02:14
created

CreateCommentsTables   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 37
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 15 1
A down() 0 6 1
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use \jlourenco\base\Database\Blueprint;
5
6
class CreateCommentsTables 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
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
17
        Schema::create('Comment', function (Blueprint $table) {
18
            $table->increments('id');
19
            $table->integer('parent')->unsigned()->nullable();
20
            $table->text('comment');
21
            $table->timestamps();
22
            $table->softDeletes();
23
            $table->creation();
24
25
            $table->foreign('parent')->references('id')->on('Comment');
26
        });
27
28
    }
29
30
    /**
31
     * Reverse the migrations.
32
     *
33
     * @return void
34
     */
35
    public function down()
36
    {
37
38
        Schema::drop('Comment');
39
40
    }
41
42
}
43