Replace database "update_" config entries with key-value entries

This commit is contained in:
Philipp 2022-12-29 21:43:52 +01:00
parent 1ed67fba3d
commit 965caf98a5
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
2 changed files with 5 additions and 2 deletions

View file

@ -42,7 +42,7 @@ class DBSync extends BaseAdmin
switch ($action) { switch ($action) {
case 'mark': case 'mark':
if ($update) { if ($update) {
DI::config()->set('database', 'update_' . $update, 'success'); DI::keyValue()->set('database_update_' . $update, 'success');
$curr = DI::config()->get('system', 'build'); $curr = DI::config()->get('system', 'build');
if (intval($curr) == $update) { if (intval($curr) == $update) {
DI::config()->set('system', 'build', intval($curr) + 1); DI::config()->set('system', 'build', intval($curr) + 1);

View file

@ -1150,7 +1150,8 @@ function update_1505()
{ {
$conditions = [ $conditions = [
"((`cat` = ?) AND ((`k` LIKE ?) OR (`k` = ?) OR (`k` LIKE ?) OR (`k` = ?))) OR " . "((`cat` = ?) AND ((`k` LIKE ?) OR (`k` = ?) OR (`k` LIKE ?) OR (`k` = ?))) OR " .
"((`cat` != ?) AND (`k` LIKE ?))", "((`cat` != ?) AND (`k` LIKE ?)) OR " .
"((`cat` = ?) AND (`k` LIKE ?))",
"system", "system",
"post_update_%", "post_update_%",
"worker_last_cleaned", "worker_last_cleaned",
@ -1158,6 +1159,8 @@ function update_1505()
"worker_daemon_mode", "worker_daemon_mode",
"system", "system",
"last_%", "last_%",
"database",
"update_%",
]; ];
$postUpdateEntries = DBA::selectToArray('config', ['cat', 'k', 'v'], $conditions); $postUpdateEntries = DBA::selectToArray('config', ['cat', 'k', 'v'], $conditions);