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

CreatePreCheckoutQueryTable::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
<?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