Completed
Pull Request — master (#23)
by Armando
10:28
created

UpdateSchema0570To0580::up()   A

Complexity

Conditions 2
Paths 3

Size

Total Lines 12

Duplication

Lines 12
Ratio 100 %

Importance

Changes 0
Metric Value
dl 12
loc 12
rs 9.8666
c 0
b 0
f 0
cc 2
nc 3
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
use Illuminate\Database\Schema\Blueprint;
6
use Illuminate\Support\Facades\Schema;
7
use PhpTelegramBot\Laravel\Migration;
8
9 View Code Duplication
class UpdateSchema0570To0580 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...
10
{
11
    public function up(): void
12
    {
13
        try {
14
            Schema::dropIfExists($this->prefix . 'botan_shortener');
15
            Schema::table($this->prefix . 'message', static function (Blueprint $table) {
16
                $table->text('reply_markup')->nullable()->comment('Inline keyboard attached to the message')->after('passport_data');
17
            });
18
        } catch (Throwable $e) {
19
            \Log::error($e->getMessage ());
20
            return; // Migration may be partly done already...
21
        }
22
    }
23
24
    public function down(): void
25
    {
26
        try {
27
            Schema::table($this->prefix . 'message', static function (Blueprint $table) {
28
                $table->dropColumn('reply_markup');
29
            });
30
        } catch (Throwable $e) {
31
            \Log::error($e->getMessage ());
32
            return; // Migration may be partly done already...
33
        }
34
    }
35
}
36