From 0ee6352a05755faf6247d69fa040e64c5d208505 Mon Sep 17 00:00:00 2001 From: jensp Date: Wed, 14 Dec 2011 12:00:23 +0000 Subject: [PATCH] =?UTF-8?q?Update=20f=C3=BCr=20hierarchy-Tabelle=20in=20ri?= =?UTF-8?q?chtige=20Datei=20verschoben.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@1350 8810af33-2d31-482b-a856-94f89814c4df --- .../create_orgaunit_hierarchy_table.sql | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/create_orgaunit_hierarchy_table.sql diff --git a/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/create_orgaunit_hierarchy_table.sql b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/create_orgaunit_hierarchy_table.sql new file mode 100644 index 000000000..bac9d493b --- /dev/null +++ b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/create_orgaunit_hierarchy_table.sql @@ -0,0 +1,42 @@ +-- +-- Copyright (C) 2011 Jens Pelzetter All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $Id: upd_table_persons.sql pboy $ + +-- This update is only applicable for the internal development tree at +-- University of Bremen ! Don't use for the APLAWS main trunk on +-- fedorahosted! + +CREATE TABLE cms_organizationalunits_hierarchy_map ( + superior_orgaunit_id integer NOT NULL, + subordinate_orgaunit_id integer NOT NULL, + assoc_type character varying(128), + superior_orgaunit_order integer, + subordinate_orgaunit_order integer +); + +-- No sure how to get db owner here +-- ALTER TABLE public.cms_organizationalunits_hierarchy_map OWNER TO iaw; + +ALTER TABLE ONLY cms_organizationalunits_hierarchy_map + ADD CONSTRAINT cms_org_hie_map_sub_or_p_nykpq PRIMARY KEY (subordinate_orgaunit_id, superior_orgaunit_id); + +ALTER TABLE ONLY cms_organizationalunits_hierarchy_map + ADD CONSTRAINT cms_org_hie_map_sub_or_f_xq5is FOREIGN KEY (subordinate_orgaunit_id) REFERENCES cms_organizationalunits(organizationalunit_id); + +ALTER TABLE ONLY cms_organizationalunits_hierarchy_map + ADD CONSTRAINT cms_org_hie_map_sup_or_f_qchkn FOREIGN KEY (superior_orgaunit_id) REFERENCES cms_organizationalunits(organizationalunit_id); \ No newline at end of file