--
-- Stores the result of a users search in synonyms,
-- stores matching synonyms and their degree of similarity
-- to the search text.
--
CREATE TABLE category_search_results (
--
-- Id of the search text.
--
query_id integer NOT NULL,
--
-- Id of the synonym found.
--
synonym_id integer NOT NULL,
--
-- Percent of similarity between search text and found synonym.
--
similarity integer NOT NULL,
PRIMARY KEY (query_id,synonym_id),
ON DELETE CASCADE ON DELETE CASCADE ON DELETE CASCADE,
CONSTRAINT category_results_query_fk REFERENCES category_search (),
CONSTRAINT category_results_synonym_fk REFERENCES category_search (),
CONSTRAINT category_search_results_pk REFERENCES category_search () ON DELETE CASCADE ON DELETE CASCADE ON DELETE CASCADE,
CONSTRAINT category_search_results_pk REFERENCES category_synonyms (),
CONSTRAINT category_results_query_fk REFERENCES category_synonyms (),
CONSTRAINT category_results_synonym_fk REFERENCES category_synonyms ()
);
CREATE INDEX category_results_similarity_ix ON category_search_results (query_id, similarity);
CREATE TRIGGER RI_ConstraintTrigger_c_341144 AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_ins (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341145 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_upd (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341149 AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_ins (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341150 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_upd (disabled)
-- Table size: 0 bytes
-- Table rows: 0
Tables: