CreateShortsTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
c 0
b 0
f 0
dl 0
loc 22
rs 10
wmc 2

2 Methods

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