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

CreatePollAnswerTable::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
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 View Code Duplication
class CreatePollAnswerTable extends Migration
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    public function up()
11
    {
12
        Schema::create(config('phptelegrambot.database.prefix', '') . 'poll_answer', static function (Blueprint $table) {
13
            $table->bigInteger('poll_id')->unsigned()->comment('Unique poll identifier');
14
            $table->bigInteger('user_id')->comment('The user, who changed the answer to the poll');
15
            $table->text ('option_ids')->comment ('0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.');
16
            $table->timestamp('created_at')->nullable()->comment ('Entry date creation');
17
            $table->primary (['poll_id', 'user_id']);
18
        });
19
    }
20
21
    public function down()
22
    {
23
        Schema::dropIfExists(config('phptelegrambot.database.prefix', '') . 'poll_answer');
24
    }
25
}
26