CreateShortLinksTable::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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