From f6ed67b75adea6664af6da3f16b1ead95a3a4eb7 Mon Sep 17 00:00:00 2001 From: seo Date: Thu, 23 Jul 2026 02:49:18 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B6=88=ED=95=84=EC=9A=94=ED=95=9C=20?= =?UTF-8?q?=EC=83=81=ED=83=9C=20=EB=A7=88=EC=9D=B4=EA=B7=B8=EB=A0=88?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.php | 55 ----------------------------------------------- 1 file changed, 55 deletions(-) diff --git a/config/config.php b/config/config.php index c0469d7..7ad947b 100644 --- a/config/config.php +++ b/config/config.php @@ -472,61 +472,6 @@ function bootstrap_db(): void COLLATE=utf8mb4_unicode_ci "); - $legacyJsonStoreExists = (bool)$pdo->query(" - SELECT COUNT(*) - FROM INFORMATION_SCHEMA.TABLES - WHERE TABLE_SCHEMA = DATABASE() - AND TABLE_NAME = 'app_json_store' - ")->fetchColumn(); - - if ($legacyJsonStoreExists) { - $pdo->exec(" - INSERT IGNORE INTO power_event_states - (event_key, active, active_since, last_detected_at, last_cleared_at, last_duration_seconds, event_history, refreshed_at) - SELECT - CASE store_key - WHEN 'file:control-low-voltage-state' THEN 'low_voltage' - WHEN 'file:control-throttling-state' THEN 'throttling' - ELSE store_key - END, - JSON_UNQUOTE(JSON_EXTRACT(payload, '$.active')) IN ('true', '1'), - JSON_EXTRACT(payload, '$.active_since'), - JSON_EXTRACT(payload, '$.last_detected_at'), - JSON_EXTRACT(payload, '$.last_cleared_at'), - COALESCE(JSON_EXTRACT(payload, '$.last_duration_seconds'), 0), - COALESCE(JSON_EXTRACT(payload, '$.events'), JSON_ARRAY()), - JSON_EXTRACT(payload, '$.updated_at') - FROM app_json_store - WHERE store_key IN ('file:control-low-voltage-state', 'file:control-throttling-state') - "); - - $pdo->exec(" - INSERT IGNORE INTO battery_profile_cache - (days, created_at_epoch, sample_rows, expires_at) - SELECT - CAST(REPLACE(REPLACE(store_key, 'battery_profile:', ''), 'd', '') AS UNSIGNED), - COALESCE(JSON_EXTRACT(payload, '$.created_at'), UNIX_TIMESTAMP()), - COALESCE(JSON_EXTRACT(payload, '$.rows'), JSON_ARRAY()), - COALESCE(expires_at, DATE_ADD(NOW(), INTERVAL 6 HOUR)) - FROM app_json_store - WHERE store_key LIKE 'battery_profile:%' - "); - - $pdo->exec(" - INSERT IGNORE INTO systemd_service_cache - (cache_key, captured_at, service_rows, expires_at) - SELECT - 1, - COALESCE(JSON_EXTRACT(payload, '$.created_at'), UNIX_TIMESTAMP()), - COALESCE(JSON_EXTRACT(payload, '$.rows'), JSON_ARRAY()), - COALESCE(expires_at, DATE_ADD(NOW(), INTERVAL 5 SECOND)) - FROM app_json_store - WHERE store_key = 'custom_services' - "); - - $pdo->exec("DROP TABLE app_json_store"); - } - $pdo->exec(" CREATE TABLE IF NOT EXISTS wifi_client_aliases ( mac VARCHAR(17) NOT NULL PRIMARY KEY,