--
-- Maps trees to objects (usually package instances) so that
-- other objects can be categorized.
--
CREATE TABLE category_tree_map (
--
-- ID of the mapped tree (see category_trees).
--
tree_id integer NOT NULL,
--
-- ID of the mapped object (usually an apm_package if trees are to be used
-- in a whole package instance, i.e. file-storage).
--
object_id integer NOT NULL,
--
-- If a subtree is mapped, then this is the ID of the category on top
-- of the subtree, null otherwise.
--
subtree_category_id integer,
--
-- Are the users allowed to assign multiple or only a single category
-- to objects?
--
assign_single_p bool DEFAULT false,
--
-- Do the users have to assign at least one category to objects?
--
require_category_p bool DEFAULT false,
widget varchar(20),
PRIMARY KEY (tree_id,object_id),
ON DELETE CASCADE ON DELETE CASCADE ON DELETE CASCADE ON DELETE CASCADE,
CONSTRAINT cat_tree_map_object_id_fk REFERENCES acs_objects (),
CONSTRAINT cat_tree_map_subtree_id_fk REFERENCES acs_objects (),
CONSTRAINT cat_tree_map_tree_id_fk REFERENCES acs_objects (),
CONSTRAINT category_tree_map_pkey REFERENCES acs_objects (),
CONSTRAINT category_tree_map_pkey REFERENCES categories (),
CONSTRAINT cat_tree_map_tree_id_fk REFERENCES categories (),
CONSTRAINT cat_tree_map_subtree_id_fk REFERENCES categories (),
CONSTRAINT cat_tree_map_object_id_fk REFERENCES categories () ON DELETE CASCADE ON DELETE CASCADE ON DELETE CASCADE ON DELETE CASCADE,
CONSTRAINT category_tree_map_pkey REFERENCES category_trees (),
CONSTRAINT cat_tree_map_object_id_fk REFERENCES category_trees (),
CONSTRAINT cat_tree_map_subtree_id_fk REFERENCES category_trees (),
CONSTRAINT cat_tree_map_tree_id_fk REFERENCES category_trees ()
);
CREATE UNIQUE INDEX cat_tree_map_ix ON category_tree_map (tree_id, object_id);
CREATE INDEX category_index_object_id_idx ON category_tree_map (object_id);
CREATE TRIGGER RI_ConstraintTrigger_c_341104 AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_ins (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341105 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_upd (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341109 AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_ins (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341110 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_upd (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341114 AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_ins (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341115 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_upd (disabled)
-- Table size: 8,192 bytes
-- Table rows: 3
Tables: