CreateFollowsTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 12
c 2
b 0
f 0
dl 0
loc 27
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 3 1
A up() 0 12 1
1
<?php
2
3
/*
4
 * This file is part of the sebastian-kennedy/laravel-follow.
5
 *
6
 * (c) SebastianKennedy <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled.
9
 */
10
11
use Illuminate\Database\Migrations\Migration;
12
use Illuminate\Database\Schema\Blueprint;
13
use Illuminate\Support\Facades\Schema;
14
15
/**
16
 * Class CreateFollowsTable.
17
 */
18
class CreateFollowsTable extends Migration
19
{
20
    /**
21
     * Run the migrations.
22
     */
23
    public function up()
24
    {
25
        Schema::create(
26
            config('follow.table_name'),
27
            function (Blueprint $table) {
28
                $table->bigIncrements('id');
29
                $table->unsignedBigInteger('follower_id');
30
                $table->unsignedBigInteger('following_id');
31
                $table->timestamp('accepted_at')->nullable();
32
                $table->timestamp('rejected_at')->nullable();
33
                $table->timestamp('special_followed_at')->nullable();
34
                $table->timestamps();
35
            }
36
        );
37
    }
38
39
    /**
40
     * Rollback the migrations.
41
     */
42
    public function down()
43
    {
44
        Schema::dropIfExists(config('follow.table_name'));
45
    }
46
}
47