Redirect404Table   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 13 1
A down() 0 2 1
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