CreateFollowsTable::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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