Code Duplication    Length = 26-27 lines in 2 locations

src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php 1 location

@@ 9-34 (lines=26) @@
6
use Illuminate\Support\Facades\Schema;
7
use PhpTelegramBot\Laravel\Migration;
8
9
class UpdateSchema0530To0540 extends Migration
10
{
11
    public function up(): void
12
    {
13
        try {
14
            Schema::table($this->prefix . 'message', static function (Blueprint $table) {
15
                $table->text('game')->nullable()->comment('Message is a game, information about the game.')->after('document');
16
            });
17
        } catch (Throwable $e) {
18
            \Log::error($e->getMessage ());
19
            return; // Migration may be partly done already...
20
        }
21
    }
22
23
    public function down(): void
24
    {
25
        try {
26
            Schema::table($this->prefix . 'message', static function (Blueprint $table) {
27
                $table->dropColumn('game');
28
            });
29
        } catch (Throwable $e) {
30
            \Log::error($e->getMessage ());
31
            return; // Migration may be partly done already...
32
        }
33
    }
34
}
35

src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php 1 location

@@ 9-35 (lines=27) @@
6
use Illuminate\Support\Facades\Schema;
7
use PhpTelegramBot\Laravel\Migration;
8
9
class UpdateSchema0570To0580 extends Migration
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