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