From 5b359b0a16a8951f769d7b273358f25e83eb5966 Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Wed, 4 Feb 2026 01:53:35 +0100 Subject: [PATCH] asd --- config/current.ver | 2 +- src/ApiKernel.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/config/current.ver b/config/current.ver index 8bd7d68..a71fcbe 100644 --- a/config/current.ver +++ b/config/current.ver @@ -1 +1 @@ -1.2.40 \ No newline at end of file +1.2.41 \ No newline at end of file diff --git a/src/ApiKernel.php b/src/ApiKernel.php index a40c51f..f59a329 100644 --- a/src/ApiKernel.php +++ b/src/ApiKernel.php @@ -4349,6 +4349,18 @@ class ApiKernel $allowed = ['bridge_url', 'bridge_token', 'sender_token', 'external_api_token', 'editor_default', 'bridge_tables', 'bridge_setup', 'versions_retention']; $fields = array_intersect_key($data, array_flip($allowed)); if (!$fields) return $this->getCustomerSettings($customerId); + if (array_key_exists('versions_retention', $fields)) { + try { + $columns = $this->tableColumns($this->customerSettingsTable()); + if (!in_array('versions_retention', $columns, true)) { + $sql = 'ALTER TABLE `' . $this->customerSettingsTable() . '` ADD COLUMN `versions_retention` int(10) unsigned DEFAULT 0'; + $this->pdo->exec($sql); + } + } catch (Throwable $e) { + // Falls die Spalte nicht angelegt werden kann, Einstellung ignorieren. + unset($fields['versions_retention']); + } + } if (array_key_exists('bridge_tables', $fields)) { $normalized = $this->normalizeBridgeTables($fields['bridge_tables']); $fields['bridge_tables'] = $normalized ? $this->encodeBridgeTables($normalized) : null; @@ -4693,6 +4705,7 @@ CREATE TABLE IF NOT EXISTS `$table` ( `external_api_token` varchar(255) DEFAULT NULL, `editor_default` varchar(32) DEFAULT NULL, `bridge_tables` text DEFAULT NULL, + `versions_retention` int(10) unsigned DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`customer_id`) @@ -4733,6 +4746,9 @@ SQL; if (!in_array('editor_default', $columns, true)) { $missing[] = 'ADD COLUMN `editor_default` varchar(32) DEFAULT NULL'; } + if (!in_array('versions_retention', $columns, true)) { + $missing[] = 'ADD COLUMN `versions_retention` int(10) unsigned DEFAULT 0'; + } if (!$missing) { return;