From de6095a6bfd3dbc61b66bbf046614fa692dfb388 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Wed, 29 Jul 2026 00:21:05 -0400 Subject: [PATCH] Store more in history table --- schema.sql | 3 +++ src/copyvios/checker.py | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/schema.sql b/schema.sql index 1d406ef..6a19234 100644 --- a/schema.sql +++ b/schema.sql @@ -29,12 +29,15 @@ CREATE TABLE history ( hist_cache_id VARCHAR(32) NOT NULL, hist_site VARCHAR(1024) NOT NULL, hist_page_title VARCHAR(1024) NOT NULL, + hist_query_oldid VARCHAR(16) DEFAULT NULL, hist_timestamp TIMESTAMP NOT NULL DEFAULT current_timestamp(), hist_user VARCHAR(1024) DEFAULT NULL, hist_best_url VARCHAR(1024) DEFAULT NULL, hist_best_confidence DOUBLE NOT NULL DEFAULT 0, hist_num_queries INT(4) NOT NULL DEFAULT 0, hist_process_time DOUBLE NOT NULL DEFAULT 0, + hist_use_engine BOOLEAN NOT NULL DEFAULT 0, + hist_use_links BOOLEAN NOT NULL DEFAULT 0, hist_did_short_circuit BOOLEAN NOT NULL DEFAULT 0, hist_via_api BOOLEAN NOT NULL DEFAULT 0, PRIMARY KEY (hist_id), diff --git a/src/copyvios/checker.py b/src/copyvios/checker.py index 27fcd1e..3d12947 100644 --- a/src/copyvios/checker.py +++ b/src/copyvios/checker.py @@ -380,24 +380,30 @@ def _cache_result( hist_cache_id, hist_site, hist_page_title, + hist_query_oldid, hist_user, hist_best_url, hist_best_confidence, hist_num_queries, hist_process_time, + hist_use_engine, + hist_use_links, hist_did_short_circuit, hist_via_api - ) VALUES ({q}, {q}, {q}, {q}, {q}, {q}, {q}, {q}, {q}, {q}) + ) VALUES ({q}, {q}, {q}, {q}, {q}, {q}, {q}, {q}, {q}, {q}, {q}, {q}, {q}) """, ( cache_id, page.site.name, page.title, + query.oldid, _get_username(), result.url, result.confidence, result.queries, result.time, + query.use_engine, + query.use_links, result.possible_miss, isinstance(query, APIQuery), ),