<?php
require_once 'config/config.php';

try {
    $sql = "ALTER TABLE tbl_tracking ADD COLUMN updated_at DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP";
    $pdo->exec($sql);
    echo "Column 'updated_at' added successfully to tbl_tracking.\n";
} catch (PDOException $e) {
    if (strpos($e->getMessage(), 'Duplicate column name') !== false) {
        echo "Column 'updated_at' already exists.\n";
    } else {
        echo "Error: " . $e->getMessage() . "\n";
    }
}
?>