Skip to content

Commit

Permalink
Fix DB Upgrade to 5.0.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-unwin committed Dec 5, 2023
1 parent d97e86b commit 981c296
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion app/Controllers/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,11 @@ public function update($action)
$output = $this->databaseModel->update();
$sql = "SELECT * FROM configuration WHERE `name` = 'license_eula'";
$db = db_connect();
$eula = $db->query($sql)->getResult()[0];
$eula = new \stdClass();
$test = $db->query($sql)->getResult();
if (!empty($test[0])) {
$elua = $test[0];
}
$item = new \stdClass();
if (!empty($eula->value) and $eula->value !== '') {
$item = json_decode($eula->value);
Expand Down
4 changes: 2 additions & 2 deletions app/Models/db_upgrades/db_5.0.2.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$output .= "Upgrade database to 5.0.2 commenced.\n\n";

// set our versions
$sql = "UPDATE `configuration` SET `value` = '20231130' WHERE `name` = 'internal_version'";
$sql = "UPDATE `configuration` SET `value` = '20231207' WHERE `name` = 'internal_version'";
$db->query($sql);
$output .= str_replace("\n", " ", (string)$db->getLastQuery()) . "\n\n";
log_message('info', (string)$db->getLastQuery());
Expand All @@ -13,5 +13,5 @@
log_message('info', (string)$db->getLastQuery());

$output .= "Upgrade database to 5.0.2 completed.\n\n";
config('Openaudit')->internal_version = 20231130;
config('Openaudit')->internal_version = 20231207;
config('Openaudit')->display_version = '5.0.2';

0 comments on commit 981c296

Please sign in to comment.