From 4dc164a5a157ffccb80485248f5d04d219dc688c Mon Sep 17 00:00:00 2001 From: Philipp Date: Sun, 12 Feb 2023 16:44:56 +0100 Subject: [PATCH] manually check and create the Config table before running the update --- src/Core/Update.php | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/Core/Update.php b/src/Core/Update.php index 0f0484b4e7..a4c5cf313e 100644 --- a/src/Core/Update.php +++ b/src/Core/Update.php @@ -129,22 +129,30 @@ class Update DI::lock()->release('dbupdate', true); } + if (!DBStructure::existsTable('config')) { + DBA::e(<<get('system', 'build'); if (empty($build)) { - // legacy option - check if the Config table exists - if (DBStructure::existsTable('config')) { - $dbConfig = DBA::selectFirst('config', ['v'], ['cat' => 'system', 'k' => 'build']); - if (!empty($dbConfig)) { - $build = $dbConfig['v']; - } + $dbConfig = DBA::selectFirst('config', ['v'], ['cat' => 'system', 'k' => 'build']); + if (!empty($dbConfig)) { + $build = $dbConfig['v']; } if (empty($build) || ($build > DB_UPDATE_VERSION)) { - // legacy option - check if the Config table exists - if (DBStructure::existsTable('config')) { - DI::config()->set('system', 'build', DB_UPDATE_VERSION - 1); - } + DI::config()->set('system', 'build', DB_UPDATE_VERSION - 1); $build = DB_UPDATE_VERSION - 1; } }