CreateCallbackQueryTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 3 1
A up() 0 11 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 CreateCallbackQueryTable extends Migration
10
{
11
    public function up(): void
12
    {
13
        Schema::create('callback_query', static function (Blueprint $table) {
14
            $table->bigInteger('id')->unsigned()->primary()->comment('Unique identifier for this query');
15
            $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier');
16
            $table->bigInteger('chat_id')->nullable()->index('chat_id')->comment('Unique chat identifier');
17
            $table->bigInteger('message_id')->unsigned()->nullable()->index('message_id')->comment('Unique message identifier');
18
            $table->char('inline_message_id')->nullable()->comment('Identifier of the message sent via the bot in inline mode, that originated the query');
19
            $table->char('data')->default('')->comment('Data associated with the callback button');
20
            $table->dateTime('created_at')->nullable()->comment('Entry date creation');
21
            $table->index(['chat_id', 'message_id'], 'chat_id_2');
22
        });
23
    }
24
25
    public function down(): void
26
    {
27
        Schema::dropIfExists('callback_query');
28
    }
29
}
30