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

CreateTelegramUpdateTable   A

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 up() 0 11 1
A down() 0 3 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 CreateTelegramUpdateTable extends Migration
10
{
11
    public function up(): void
12
    {
13
        Schema::create('telegram_update', static function (Blueprint $table) {
14
            $table->bigInteger('id')->unsigned()->primary()->comment('Update\'s unique identifier');
15
            $table->bigInteger('chat_id')->nullable()->comment('Unique chat identifier');
16
            $table->bigInteger('message_id')->unsigned()->nullable()->comment('Unique message identifier');
17
            $table->bigInteger('inline_query_id')->unsigned()->nullable()->index('inline_query_id')->comment('Unique inline query identifier');
18
            $table->bigInteger('chosen_inline_result_id')->unsigned()->nullable()->index('chosen_inline_result_id')->comment('Local chosen inline result identifier');
19
            $table->bigInteger('callback_query_id')->unsigned()->nullable()->index('callback_query_id')->comment('Unique callback query identifier');
20
            $table->bigInteger('edited_message_id')->unsigned()->nullable()->index('edited_message_id')->comment('Local edited message identifier');
21
            $table->index(['chat_id', 'message_id'], 'message_id');
22
        });
23
    }
24
25
    public function down(): void
26
    {
27
        Schema::dropIfExists('telegram_update');
28
    }
29
}
30