diff --git a/system/migrations/20.php b/system/migrations/20.php index 1d08985f..ccc20a51 100644 --- a/system/migrations/20.php +++ b/system/migrations/20.php @@ -2,7 +2,10 @@ use MyAAC\Settings; -$up = function () use ($db) { +function updateHighscoresIdsHidden(): void +{ + global $db; + if (!$db->hasTable('players')) { return; } @@ -19,6 +22,10 @@ $up = function () use ($db) { $settings = Settings::getInstance(); $settings->updateInDatabase('core', 'highscores_ids_hidden', implode(', ', $highscores_ignored_ids)); +} + +$up = function () { + updateHighscoresIdsHidden(); }; $down = function () { diff --git a/system/migrations/3.php b/system/migrations/3.php index 4bb21872..f79dcbe7 100644 --- a/system/migrations/3.php +++ b/system/migrations/3.php @@ -9,7 +9,7 @@ $up = function () use ($db) { } }; -$down = function () use ($db) { +$down = function () { // we don't want data loss //$db->dropColumn(TABLE_PREFIX . 'account_actions', 'ipv6'); }; diff --git a/system/migrations/33.php b/system/migrations/33.php index 6eef23a9..97c39fcc 100644 --- a/system/migrations/33.php +++ b/system/migrations/33.php @@ -11,6 +11,6 @@ $up = function () use ($db) { $db->modifyColumn(TABLE_PREFIX . 'visitors', 'ip', 'VARCHAR(15) NOT NULL'); }; -$down = function () use ($db) { +$down = function () { // nothing to be done, as we have just extended the size of a column }; diff --git a/system/migrations/36.php b/system/migrations/36.php index ac6969f8..1f27c51f 100644 --- a/system/migrations/36.php +++ b/system/migrations/36.php @@ -10,7 +10,7 @@ $up = function () use ($db) { } }; -$down = function () use ($db) { +$down = function () { // will break the aac //if ($db->hasTable(TABLE_PREFIX . 'settings')) { // $db->dropTable(TABLE_PREFIX . 'settings'); diff --git a/system/migrations/38.php b/system/migrations/38.php index 24dd2f72..f42a4d53 100644 --- a/system/migrations/38.php +++ b/system/migrations/38.php @@ -5,8 +5,9 @@ // 2023-11-11 // execute highscores_ids_hidden once again, cause of settings -$up = function () use ($db) { +$up = function () { require __DIR__ . '/20.php'; + updateHighscoresIdsHidden(); }; $down = function () {