Code Duplication    Length = 44-44 lines in 2 locations

database/migrations/2017_02_12_000428_create_Round_Competitor_table.php 1 location

@@ 7-50 (lines=44) @@
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateRoundCompetitorTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('round_competitor', function (Blueprint $table) {
17
            $table->increments('id');
18
            $table->integer('competitor_id')->unsigned()->nullable()->index();
19
            $table->integer('round_id')->unsigned()->index();
20
            $table->integer('order')->unsigned();
21
            $table->timestamps();
22
23
            $table->foreign('competitor_id')
24
                ->references('id')
25
                ->on('competitor')
26
                ->onUpdate('cascade')
27
                ->onDelete('cascade');
28
29
            $table->foreign('round_id')
30
                ->references('id')
31
                ->on('round')
32
                ->onUpdate('cascade')
33
                ->onDelete('cascade');
34
35
            $table->unique(['competitor_id', 'round_id']);
36
        });
37
    }
38
39
    /**
40
     * Reverse the migrations.
41
     *
42
     * @return void
43
     */
44
    public function down()
45
    {
46
        DB::statement('SET FOREIGN_KEY_CHECKS = 0');
47
        Schema::dropIfExists('round_competitor');
48
        DB::statement('SET FOREIGN_KEY_CHECKS = 1');
49
    }
50
}
51

database/migrations/2017_02_12_000437_create_Round_Team_table.php 1 location

@@ 7-50 (lines=44) @@
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateRoundTeamTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('round_team', function (Blueprint $table) {
17
            $table->increments('id');
18
            $table->integer('team_id')->unsigned()->nullable()->index();
19
            $table->integer('round_id')->unsigned()->index();
20
            $table->integer('order')->unsigned();
21
            $table->timestamps();
22
23
            $table->foreign('team_id')
24
                ->references('id')
25
                ->on('team')
26
                ->onUpdate('cascade')
27
                ->onDelete('cascade');
28
29
            $table->foreign('round_id')
30
                ->references('id')
31
                ->on('round')
32
                ->onUpdate('cascade')
33
                ->onDelete('cascade');
34
35
            $table->unique(['team_id', 'round_id']);
36
        });
37
    }
38
39
    /**
40
     * Reverse the migrations.
41
     *
42
     * @return void
43
     */
44
    public function down()
45
    {
46
        DB::statement('SET FOREIGN_KEY_CHECKS = 0');
47
        Schema::dropIfExists('round_team');
48
        DB::statement('SET FOREIGN_KEY_CHECKS = 1');
49
    }
50
}
51