CreateShortLinksTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 42
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 24 1
A down() 0 4 1
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\DB;
6
use Illuminate\Support\Facades\Schema;
7
8
class CreateShortLinksTable extends Migration
9
{
10
    /**
11
     * Run the migrations.
12
     *
13
     * @return void
14
     */
15
    public function up()
16
    {
17
        Schema::create('short_links', function (Blueprint $table) {
18
19
            // ID
20
            $table->string('id');
21
22
            // FK
23
            // ...
24
25
            // Data
26
            $table->string('url')->nullable();
27
            $table->date('not_before')->nullable();
28
            $table->date('expire_at')->nullable();
29
            $table->boolean('enabled')->default(true);
30
31
            // Other
32
            $table->timestamps();
33
34
            // Indexes
35
            $table->primary('id');
36
37
        });
38
    }
39
40
    /**
41
     * Reverse the migrations.
42
     *
43
     * @return void
44
     */
45
    public function down()
46
    {
47
        Schema::dropIfExists('users');
48
    }
49
}
50