Update für hierarchy-Tabelle in richtige Datei verschoben.

git-svn-id: https://svn.libreccm.org/ccm/trunk@1350 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2011-12-14 12:00:23 +00:00
parent 1910ffb72d
commit 0ee6352a05
1 changed files with 42 additions and 0 deletions

View File

@ -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);