asd
This commit is contained in:
@@ -1 +1 @@
|
|||||||
1.2.40
|
1.2.41
|
||||||
@@ -4349,6 +4349,18 @@ class ApiKernel
|
|||||||
$allowed = ['bridge_url', 'bridge_token', 'sender_token', 'external_api_token', 'editor_default', 'bridge_tables', 'bridge_setup', 'versions_retention'];
|
$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));
|
$fields = array_intersect_key($data, array_flip($allowed));
|
||||||
if (!$fields) return $this->getCustomerSettings($customerId);
|
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)) {
|
if (array_key_exists('bridge_tables', $fields)) {
|
||||||
$normalized = $this->normalizeBridgeTables($fields['bridge_tables']);
|
$normalized = $this->normalizeBridgeTables($fields['bridge_tables']);
|
||||||
$fields['bridge_tables'] = $normalized ? $this->encodeBridgeTables($normalized) : null;
|
$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,
|
`external_api_token` varchar(255) DEFAULT NULL,
|
||||||
`editor_default` varchar(32) DEFAULT NULL,
|
`editor_default` varchar(32) DEFAULT NULL,
|
||||||
`bridge_tables` text DEFAULT NULL,
|
`bridge_tables` text DEFAULT NULL,
|
||||||
|
`versions_retention` int(10) unsigned DEFAULT 0,
|
||||||
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
PRIMARY KEY (`customer_id`)
|
PRIMARY KEY (`customer_id`)
|
||||||
@@ -4733,6 +4746,9 @@ SQL;
|
|||||||
if (!in_array('editor_default', $columns, true)) {
|
if (!in_array('editor_default', $columns, true)) {
|
||||||
$missing[] = 'ADD COLUMN `editor_default` varchar(32) DEFAULT NULL';
|
$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) {
|
if (!$missing) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user