Redirect404Table::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 11
nc 1
nop 0
dl 0
loc 13
rs 9.9
c 1
b 0
f 0
1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
6
class Redirect404Table extends Migration
7
{
8
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('redirect', function (Blueprint $table) {
17
            $table->increments('id');
18
            $table->boolean('active')->default(false);
19
            $table->integer('clicks')->default(0);
20
            $table->string('url')->unique();
21
            $table->string('redirect_url')->nullable();
22
            $table->integer('shop_id')->unsigned()->nullable();
23
            $table->foreign('shop_id')->references('id')->on('shop')->onDelete('cascade');
24
            $table->integer('modified_by_user_id')->unsigned()->nullable();
25
            $table->foreign('modified_by_user_id')->references('id')->on('user')->onDelete('set null');
26
            $table->timestamps();
27
        });
28
    }
29
30
    /**
31
     * Reverse the migrations.
32
     *
33
     * @return void
34
     */
35
    public function down()
36
    {
37
     //
38
    }
39
}
40