JezK
Edit File: scratch_db_update_settings.php
<?php require_once __DIR__ . '/config/db.php'; $pdo = db(); try { // Create Settings table $pdo->exec(" CREATE TABLE IF NOT EXISTS `settings` ( `setting_key` VARCHAR(50) NOT NULL PRIMARY KEY, `setting_value` TEXT, `description` TEXT, `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; "); // Insert Default Keys $stmt = $pdo->prepare("INSERT IGNORE INTO `settings` (`setting_key`, `setting_value`, `description`) VALUES (?, ?, ?)"); $stmt->execute(['anomaly_high_expense', '5000', 'Expense amount threshold to trigger a high-expense anomaly alert (INR).']); $stmt->execute(['anomaly_unauth_sittings', '1', 'Flag to enable (1) or disable (0) over-auth sitting anomaly reporting.']); echo "Migration completed successfully: settings table ready.\n"; } catch (Exception $e) { echo "Error: " . $e->getMessage() . "\n"; }