Completed
Push — master ( 4b6b6a...392426 )
by David
43:13 queued 15:02
created

CreateForumPostRepliesTable::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
6 View Code Duplication
class CreateForumPostRepliesTable extends Migration
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
7
{
8
    public function up()
9
    {
10
        if (!Schema::hasTable('forum_post_replies')) {
11
            Schema::create('forum_post_replies', function ($table) {
12
                $table->increments('id');
13
                $table->string('body', 4000);
14
                $table->integer('post_id')->unsigned();
15
                $table->foreign('post_id')
16
                      ->references('id')->on('forum_posts')
17
                      ->onDelete('cascade');
18
                $table->integer('author_id');
19
                $table->timestamps();
20
            });
21
        }
22
    }
23
24
    public function down()
25
    {
26
        Schema::dropIfExists('forum_post_replies');
27
    }
28
}
29