From: Mike Rylander Date: Mon, 2 Apr 2012 17:41:00 +0000 (-0400) Subject: Stamping upgrade script for "Org unit selective hiding and sorting in tpac library... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fec48cdd66f2338a3cea762e840352d448426b3d;p=evergreen%2Fpines.git Stamping upgrade script for "Org unit selective hiding and sorting in tpac library selector" Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 34224b1945..734f3a972c 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -87,7 +87,7 @@ CREATE TRIGGER no_overlapping_deps BEFORE INSERT OR UPDATE ON config.db_patch_dependencies FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates'); -INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0701', :eg_version); -- sprater/bshum/tsbere +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0702', :eg_version); -- berick/miker CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/0702.schema.org_unit_opac_vis_and_sorting.sql b/Open-ILS/src/sql/Pg/upgrade/0702.schema.org_unit_opac_vis_and_sorting.sql new file mode 100644 index 0000000000..8c6cd4f62b --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0702.schema.org_unit_opac_vis_and_sorting.sql @@ -0,0 +1,45 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('0702', :eg_version); + +INSERT INTO config.global_flag (name, enabled, label) + VALUES ( + 'opac.org_unit.non_inheritied_visibility', + FALSE, + oils_i18n_gettext( + 'opac.org_unit.non_inheritied_visibility', + 'Org Units Do Not Inherit Visibility', + 'cgf', + '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; +*/ + 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 deleted file mode 100644 index fd1c0023b8..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql +++ /dev/null @@ -1,45 +0,0 @@ -BEGIN; - ---SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); - -INSERT INTO config.global_flag (name, enabled, label) - VALUES ( - 'opac.org_unit.non_inheritied_visibility', - FALSE, - oils_i18n_gettext( - 'opac.org_unit.non_inheritied_visibility', - 'Org Units Do Not Inherit Visibility', - 'cgf', - '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; -*/ -