2603.8 purging old records

This commit is contained in:
2026-03-13 16:01:19 -04:00
parent 86573769ca
commit 1e57388299
8 changed files with 191 additions and 17 deletions

View File

@@ -41,4 +41,14 @@ if ($row > 0) {
echo "Dropped legacy uq_event unique key.\n";
}
// Migration: create settings table and seed default retention if upgrading
$pdo->exec(
"CREATE TABLE IF NOT EXISTS settings (
key_name VARCHAR(64) NOT NULL,
value TEXT NOT NULL,
PRIMARY KEY (key_name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4"
);
$pdo->exec("INSERT IGNORE INTO settings (key_name, value) VALUES ('retention_days', '7')");
echo "Database '" . DB_NAME . "' and tables created/migrated successfully.\n";