CreateUserFollowerTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 8
rs 10
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateUserFollowerTable extends Migration
8
{
9
    public function up()
10
    {
11
        Schema::create(config('follow.relation_table', 'user_follower'), function (Blueprint $table) {
12
            $table->increments('id');
13
            $table->unsignedBigInteger('following_id')->index();
14
            $table->unsignedBigInteger('follower_id')->index();
15
            $table->timestamp('accepted_at')->nullable()->index();
16
            $table->timestamps();
17
        });
18
    }
19
20
    public function down()
21
    {
22
        Schema::dropIfExists(config('follow.relation_table', 'user_follower'));
23
    }
24
}
25