AddForeignKeysToChosenInlineResultTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 13
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 4 1
A down() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
use Illuminate\Database\Migrations\Migration;
6
use Illuminate\Database\Schema\Blueprint;
7
use Illuminate\Support\Facades\Schema;
8
9
class AddForeignKeysToChosenInlineResultTable extends Migration
10
{
11
    public function up(): void
12
    {
13
        Schema::table('chosen_inline_result', static function (Blueprint $table) {
14
            $table->foreign('user_id', 'chosen_inline_result_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT');
15
        });
16
    }
17
18
    public function down(): void
19
    {
20
        Schema::table('chosen_inline_result', static function (Blueprint $table) {
21
            $table->dropForeign('chosen_inline_result_ibfk_1');
22
        });
23
    }
24
}
25