CreateEditedMessageTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 10
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 12
rs 9.9332
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