From ad94c8c33ccf17a94af925d5477e7747c3cb45d0 Mon Sep 17 00:00:00 2001 From: Mark Unwin Date: Wed, 31 Jan 2024 14:10:37 +1000 Subject: [PATCH] Trigger SQL upgrade for 5.1.0. --- app/Config/OpenAudit.php | 6 +++--- app/Models/DatabaseModel.php | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Config/OpenAudit.php b/app/Config/OpenAudit.php index bcc16be27..b716d825e 100755 --- a/app/Config/OpenAudit.php +++ b/app/Config/OpenAudit.php @@ -10,9 +10,9 @@ class OpenAudit extends BaseConfig { - # leave for backwards compat $this->displayVersion = '5.0.3'; - public string $displayVersion = '5.0.3'; - public int $appVersion = 20231219; + # leave for backwards compat $this->displayVersion = '5.1.0'; + public string $displayVersion = '5.1.0'; + public int $appVersion = 20240104; public array $enterprise_collections = array('applications' => 'cud', 'baselines' => 'crud', 'baselines_policies' => 'crud', 'baselines_results' => 'crud', 'clouds' => 'crud', 'collectors' => 'crud', 'dashboards' => 'cud', 'discovery_scan_options' => 'cud', 'files' => 'crud', 'integrations' => 'crud', 'racks' => 'crud', 'roles' => 'cu'); public array $professional_collections = array('applications' => 'r', 'clusters' => 'crud', 'dashboards' => 'r', 'discovery_scan_options' => 'r', 'maps' => 'crud', 'rules' => 'crud', 'tasks' => 'crud', 'widgets' => 'crud'); diff --git a/app/Models/DatabaseModel.php b/app/Models/DatabaseModel.php index 87b3cf079..04bbd7e94 100644 --- a/app/Models/DatabaseModel.php +++ b/app/Models/DatabaseModel.php @@ -331,6 +331,10 @@ public function update($id = null, $data = null): bool include "db_upgrades/db_5.0.3.php"; } + if (intval(config('Openaudit')->internal_version) < 20240104) { + include "db_upgrades/db_5.1.0.php"; + } + $instance = & get_instance(); $instance->data = $output; return true;