| Total Complexity | 4 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class UpdateSchema0600To0610 extends Migration |
||
| 11 | { |
||
| 12 | public function up(): void |
||
| 13 | { |
||
| 14 | Schema::disableForeignKeyConstraints(); |
||
| 15 | |||
| 16 | try { |
||
| 17 | Schema::table($this->prefix . 'telegram_update', static function (Blueprint $table) { |
||
| 18 | $table->dropIndex('message_id'); |
||
| 19 | $table->index('message_id', 'message_id'); |
||
| 20 | $table->index(['chat_id', 'message_id'], 'chat_message_id'); |
||
| 21 | }); |
||
| 22 | } catch (Throwable $e) { |
||
| 23 | Log::error($e->getMessage()); |
||
| 24 | return; // Migration may be partly done already... |
||
| 25 | } |
||
| 26 | |||
| 27 | Schema::enableForeignKeyConstraints(); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function down(): void |
||
| 46 | } |
||
| 47 | } |
||
| 48 |