CreateEditedMessageTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 20
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
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 CreateEditedMessageTable extends Migration
10
{
11
    public function up(): void
12
    {
13
        Schema::create('edited_message', static function (Blueprint $table) {
14
            $table->bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry');
15
            $table->bigInteger('chat_id')->nullable()->index('chat_id')->comment('Unique chat identifier');
16
            $table->bigInteger('message_id')->unsigned()->nullable()->index('message_id')->comment('Unique message identifier');
17
            $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier');
18
            $table->dateTime('edit_date')->nullable()->comment('Date the message was edited in timestamp format');
19
            $table->text('text')->nullable()->comment('For text messages, the actual UTF-8 text of the message max message length 4096 char utf8');
20
            $table->text('entities')->nullable()->comment('For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text');
21
            $table->text('caption')->nullable()->comment('For message with caption, the actual UTF-8 text of the caption');
22
            $table->index(['chat_id', 'message_id'], 'chat_id_2');
23
        });
24
    }
25
26
    public function down(): void
27
    {
28
        Schema::dropIfExists('edited_message');
29
    }
30
}
31