From: Bill Erickson Date: Mon, 19 Mar 2012 20:30:52 +0000 (-0400) Subject: custom org tree : db / idl (todo: update schema) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6f7f0fbc20766cf17784bcbd335e4eff3877100b;p=evergreen%2Fequinox.git custom org tree : db / idl (todo: update schema) Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 1c92c2e692..b707d648a4 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -4921,6 +4921,45 @@ SELECT usr, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql index 115613ab6f..fd1c0023b8 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql @@ -14,11 +14,32 @@ INSERT INTO config.global_flag (name, enabled, label) ) ); +CREATE TYPE actor.org_unit_custom_tree_purpose AS ENUM ('opac'); + +CREATE TABLE actor.org_unit_custom_tree ( + id SERIAL PRIMARY KEY, + active BOOLEAN DEFAULT FALSE, + purpose actor.org_unit_custom_tree_purpose NOT NULL DEFAULT 'opac' UNIQUE +); + +CREATE TABLE actor.org_unit_custom_tree_node ( + id SERIAL PRIMARY KEY, + tree INTEGER REFERENCES actor.org_unit_custom_tree (id) DEFERRABLE INITIALLY DEFERRED, + org_unit INTEGER NOT NULL REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED, + parent_node INTEGER REFERENCES actor.org_unit_custom_tree_node (id) DEFERRABLE INITIALLY DEFERRED, + sibling_order INTEGER NOT NULL DEFAULT 0, + CONSTRAINT aouctn_once_per_org UNIQUE (tree, org_unit) +); + + COMMIT; /* UNDO BEGIN; DELETE FROM config.global_flag WHERE name = 'opac.org_unit.non_inheritied_visibility'; +DROP TABLE actor.org_unit_custom_tree_node; +DROP TABLE actor.org_unit_custom_tree; +DROP TYPE actor.org_unit_custom_tree_purpose; COMMIT; */