CREATE TABLE IF NOT EXISTS user_visits (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    ip TEXT NOT NULL,
    path TEXT NOT NULL,
    method TEXT NOT NULL,
    fingerprint TEXT,
    user_agent TEXT,
    referer TEXT,
    accept_language TEXT,
    timestamp DATETIME DEFAULT CURRENT_TIMESTAMP
);

CREATE INDEX IF NOT EXISTS idx_user_visits_timestamp ON user_visits(timestamp);
CREATE INDEX IF NOT EXISTS idx_user_visits_fingerprint ON user_visits(fingerprint);
CREATE INDEX IF NOT EXISTS idx_user_visits_path ON user_visits(path);
