Completed
Pull Request — master (#24)
by
unknown
11:40 queued 10s
created

CreatePreCheckoutQueryTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 13 1
A down() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
use Illuminate\Database\Migrations\Migration;
6
use Illuminate\Database\Schema\Blueprint;
7
8
class CreatePreCheckoutQueryTable extends Migration
9
{
10
    public function up()
11
    {
12
        Schema::create(config('phptelegrambot.database.prefix', '') . 'pre_checkout_query', static function (Blueprint $table) {
13
            $table->bigInteger('id')->primary()->unsigned()->comment('Unique query identifier');
14
            $table->bigInteger('user_id')->index('user_id')->nullable()->comment('User who sent the query');
15
            $table->char ('currency', 3)->nullable()->comment ('Three-letter ISO 4217 currency code');
16
            $table->bigInteger('total_amount')->nullable()->comment ('Total price in the smallest units of the currency');
17
            $table->char ('invoice_payload', 255)->comment ('Bot specified invoice payload');
18
            $table->char ('shipping_option_id', 255)->nullable()->comment ('Identifier of the shipping option chosen by the user');
19
            $table->text ('order_info')->nullable()->comment ('Order info provided by the user');
20
            $table->timestamp('created_at')->nullable()->comment ('Entry date creation');
21
        });
22
    }
23
24
    public function down()
25
    {
26
        Schema::dropIfExists(config('phptelegrambot.database.prefix', '') . 'pre_checkout_query');
27
    }
28
}
29