CreateShortsTable::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
use Helldar\ShortUrl\Conrerns\Migrationable;
4
use Illuminate\Database\Migrations\Migration;
5
use Illuminate\Database\Schema\Blueprint;
6
7
class CreateShortsTable extends Migration
8
{
9
    use Migrationable;
10
11
    public function up()
12
    {
13
        $this->createTable(static function (Blueprint $table) {
14
            $table->bigIncrements('id');
15
16
            $table->string('key')->nullable()->index();
17
            $table->string('host');
18
            $table->text('url');
19
20
            $table->unsignedBigInteger('visited')->default(0);
21
22
            $table->timestamps();
23
        });
24
    }
25
26
    public function down()
27
    {
28
        $this->tableConnection()->dropIfExists($this->table);
29
    }
30
}
31