AddForeignKeysToCommitFilesTable::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
class AddForeignKeysToCommitFilesTable extends Migration
7
{
8
    /**
9
     * Run the migrations.
10
     */
11
    public function up()
12
    {
13
        Schema::table('commit_files', function (Blueprint $table) {
14
            $table->foreign('commit_id', 'fk_commit_files_commit_id')->references('id')->on('commits')->onUpdate('NO ACTION')->onDelete('NO ACTION');
15
        });
16
    }
17
18
    /**
19
     * Reverse the migrations.
20
     */
21
    public function down()
22
    {
23
        Schema::table('commit_files', function (Blueprint $table) {
24
            $table->dropForeign('fk_commit_files_commit_id');
25
        });
26
    }
27
}
28