CreateBotanShortenerTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 8
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
use Illuminate\Database\Migrations\Migration;
6
use Illuminate\Database\Schema\Blueprint;
7
use Illuminate\Support\Facades\Schema;
8
9
class CreateBotanShortenerTable extends Migration
10
{
11
    public function up(): void
12
    {
13
        Schema::create('botan_shortener', static function (Blueprint $table) {
14
            $table->bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry');
15
            $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier');
16
            $table->text('url')->comment('Original URL');
17
            $table->char('short_url')->default('')->comment('Shortened URL');
18
            $table->dateTime('created_at')->nullable()->comment('Entry date creation');
19
        });
20
    }
21
22
    public function down(): void
23
    {
24
        Schema::dropIfExists('botan_shortener');
25
    }
26
}
27