CREATE TABLE search_history ( id INTEGER PRIMARY KEY NOT NULL, timestamp BIGINT NOT NULL, query TEXT NOT NULL, search_engine TEXT, embedding BLOB NOT NULL, created_at BIGINT NOT NULL, source_file TEXT, UNIQUE(timestamp, query) ); CREATE INDEX idx_search_timestamp ON search_history(timestamp); CREATE INDEX idx_search_query ON search_history(query);