| Total Complexity | 5 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class FixLongPmaVersions extends AbstractMigration |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * This migration strips the phpMyAdmin version of Debian, |
||
| 12 | * Ubuntu and other suffixes in version strings |
||
| 13 | */ |
||
| 14 | public function up(): void |
||
| 15 | { |
||
| 16 | // Strip phpMyAdmin versions in `reports` table |
||
| 17 | $count = $this->_sanitizeVersionsInTable('reports'); |
||
| 18 | Log::debug($count . ' reports updated'); |
||
| 19 | |||
| 20 | // Strip phpMyAdmin versions in `incidents` table |
||
| 21 | $count = $this->_sanitizeVersionsInTable('incidents'); |
||
| 22 | Log::debug($count . ' incidents updated'); |
||
| 23 | } |
||
| 24 | |||
| 25 | public function down(): void |
||
| 27 | // Once applied, this migration can't be reversed |
||
| 28 | // but the migration itself is idempotent |
||
| 29 | } |
||
| 30 | |||
| 31 | private function _sanitizeVersionsInTable(string $table): int |
||
| 58 |