| @@ 9-32 (lines=24) @@ | ||
| 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 | return; // Migration may be partly done already... |
|
| 19 | } |
|
| 20 | } |
|
| 21 | ||
| 22 | public function down(): void |
|
| 23 | { |
|
| 24 | try { |
|
| 25 | Schema::table($this->prefix . 'message', static function (Blueprint $table) { |
|
| 26 | $table->dropColumn('game'); |
|
| 27 | }); |
|
| 28 | } catch (Throwable $e) { |
|
| 29 | return; // Migration may be partly done already... |
|
| 30 | } |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| @@ 9-33 (lines=25) @@ | ||
| 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 | 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('reply_markup'); |
|
| 28 | }); |
|
| 29 | } catch (Throwable $e) { |
|
| 30 | return; // Migration may be partly done already... |
|
| 31 | } |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||