CREATE TABLE IF NOT EXISTS hr_zkteco_settings (
    id INT AUTO_INCREMENT PRIMARY KEY,
    ip_address VARCHAR(100) NOT NULL,
    port INT DEFAULT 4370,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

INSERT INTO hr_zkteco_settings (ip_address, port) 
SELECT '192.168.1.201', 4370
WHERE NOT EXISTS (SELECT 1 FROM hr_zkteco_settings);

ALTER TABLE hr_employees ADD COLUMN zkteco_uid VARCHAR(50) NULL DEFAULT NULL AFTER id;