Passed
Push — master ( fde606...0af3c0 )
by Armando
08:21
created

CreateCallbackQueryTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
cc 1
nc 1
nop 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A 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