Fixed various table and column names to adhere to Oracle restrinctions.

Update for Postgres provided, but NOT tested yet. 
(Micro) version elevated nevertheless.
(Backport of fedorahosted:2861)


git-svn-id: https://svn.libreccm.org/ccm/trunk@3011 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2014-12-07 10:41:34 +00:00
parent c531b6bbcc
commit 53f30aea0a
20 changed files with 353 additions and 92 deletions

View File

@ -2,7 +2,7 @@
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
name="ccm-cms"
prettyName="Red Hat CCM Content Management System"
version="6.6.11"
version="6.6.12"
release="1"
webapp="ROOT">
<ccm:dependencies>

View File

@ -32,7 +32,7 @@ object type ContentType extends ACSObject {
String[0..1] ancestors = content_types.ancestors VARCHAR(2000);
String[0..1] descendants = content_types.descendants VARCHAR(2000);
String[1..1] mode = content_types.mode CHAR(1);
String[1..1] mode = content_types.type_mode CHAR(1);
BigDecimal[0..1] itemFormID = content_types.item_form_id INTEGER;
AuthoringKit[0..1] authoringKit = join content_types.type_id
to authoring_kits.type_id;

View File

@ -25,11 +25,11 @@ import com.arsdigita.kernel.ACSObject;
// PDL definition for a commons base type for organizations, departments, projects etc.
object type GenericOrganizationalUnit extends ContentPage {
String[0..1] addendum = cms_organizationalunits.addendum VARCHAR(512);
String[0..1] addendum = cms_orgaunits.addendum VARCHAR(512);
String[0..1] personsStr = cms_organizationalunits.personsstr CLOB;
String[0..1] personsStr = cms_orgaunits.personsstr CLOB;
reference key (cms_organizationalunits.organizationalunit_id);
reference key (cms_orgaunits.orgaunit_id);
}
object type GenericOrganizationalUnitBundle extends ContentBundle {
@ -40,18 +40,18 @@ object type GenericOrganizationalUnitBundle extends ContentBundle {
association {
GenericOrganizationalUnitBundle[0..n] organizationalunit = join cms_contact_bundles.bundle_id
to cms_organizationalunits_contact_map.contact_id,
join cms_organizationalunits_contact_map.organizationalunit_id
to cms_orgaunits_contact_map.contact_id,
join cms_orgaunits_contact_map.orgaunit_id
to cms_orgaunit_bundles.bundle_id;
GenericContactBundle[0..n] contacts = join cms_orgaunit_bundles.bundle_id
to cms_organizationalunits_contact_map.organizationalunit_id,
join cms_organizationalunits_contact_map.contact_id
to cms_orgaunits_contact_map.orgaunit_id,
join cms_orgaunits_contact_map.contact_id
to cms_contact_bundles.bundle_id;
// Some link attributes.
String[0..1] contact_type = cms_organizationalunits_contact_map.contact_type VARCHAR(100);
Integer[0..1] contact_order = cms_organizationalunits_contact_map.map_order INTEGER;
String[0..1] contact_type = cms_orgaunits_contact_map.contact_type VARCHAR(100);
Integer[0..1] contact_order = cms_orgaunits_contact_map.map_order INTEGER;
}
@ -59,18 +59,18 @@ association {
association {
GenericOrganizationalUnitBundle[0..n] organizationalunits = join cms_person_bundles.bundle_id
to cms_organizationalunits_person_map.person_id,
join cms_organizationalunits_person_map.organizationalunit_id
to cms_orgaunits_person_map.person_id,
join cms_orgaunits_person_map.orgaunit_id
to cms_orgaunit_bundles.bundle_id;
GenericPersonBundle[0..n] persons = join cms_orgaunit_bundles.bundle_id
to cms_organizationalunits_person_map.organizationalunit_id,
join cms_organizationalunits_person_map.person_id
to cms_orgaunits_person_map.orgaunit_id,
join cms_orgaunits_person_map.person_id
to cms_person_bundles.bundle_id;
// Additional attributes for the association
String[0..1] role_name = cms_organizationalunits_person_map.role_name VARCHAR(100);
String[0..1] status = cms_organizationalunits_person_map.status VARCHAR(100);
String[0..1] role_name = cms_orgaunits_person_map.role_name VARCHAR(100);
String[0..1] status = cms_orgaunits_person_map.status VARCHAR(100);
}
@ -78,21 +78,21 @@ association {
association {
GenericOrganizationalUnitBundle[0..n] superiorOrgaunits = join cms_orgaunit_bundles.bundle_id
to cms_organizationalunits_hierarchy_map.subordinate_orgaunit_id,
join cms_organizationalunits_hierarchy_map.superior_orgaunit_id
to cms_orgaunits_hierarchy_map.subordinate_orgaunit_id,
join cms_orgaunits_hierarchy_map.superior_orgaunit_id
to cms_orgaunit_bundles.bundle_id;
GenericOrganizationalUnitBundle[0..n] subordinateOrgaunits = join cms_orgaunit_bundles.bundle_id
to cms_organizationalunits_hierarchy_map.superior_orgaunit_id,
join cms_organizationalunits_hierarchy_map.subordinate_orgaunit_id
to cms_orgaunits_hierarchy_map.superior_orgaunit_id,
join cms_orgaunits_hierarchy_map.subordinate_orgaunit_id
to cms_orgaunit_bundles.bundle_id;
//Additonal attributes for the assoication
//Optional string for *internal* data
String[0..1] assocType = cms_organizationalunits_hierarchy_map.assoc_type VARCHAR(128);
String[0..1] assocType = cms_orgaunits_hierarchy_map.assoc_type VARCHAR(128);
//Integers for sorting
Integer[0..1] superiorOrgaUnitOrder = cms_organizationalunits_hierarchy_map.superior_orgaunit_order INTEGER;
Integer[0..1] subordinateOrgaUnitOrder = cms_organizationalunits_hierarchy_map.subordinate_orgaunit_order INTEGER;
Integer[0..1] superiorOrgaUnitOrder = cms_orgaunits_hierarchy_map.superior_orgaunit_order INTEGER;
Integer[0..1] subordinateOrgaUnitOrder = cms_orgaunits_hierarchy_map.subordinate_orgaunit_order INTEGER;
}
//Returns the ids of all organizational units which are a subordinate orga unit
@ -115,8 +115,8 @@ query getIdsOfSubordinateOrgaUnitsRecursivly{
from subordinate_orgaunits sou,
cms_orgaunit_bundles ou
join cms_items on ou.bundle_id = cms_items.item_id
join cms_organizationalunits_hierarchy_map on ou.bundle_id = cms_organizationalunits_hierarchy_map.subordinate_orgaunit_id
where cms_organizationalunits_hierarchy_map.superior_orgaunit_id = sou.orgaunit_id
join cms_orgaunits_hierarchy_map on ou.bundle_id = cms_orgaunits_hierarchy_map.subordinate_orgaunit_id
where cms_orgaunits_hierarchy_map.superior_orgaunit_id = sou.orgaunit_id
)
select orgaunit_id, orgaunit_name from subordinate_orgaunits
} map {
@ -146,8 +146,8 @@ query getIdsOfSubordinateOrgaUnitsRecursivlyWithAssocType{
from subordinate_orgaunits sou,
cms_orgaunit_bundles ou
join cms_items on ou.bundle_id = cms_items.item_id
join cms_organizationalunits_hierarchy_map on ou.bundle_id = cms_organizationalunits_hierarchy_map.subordinate_orgaunit_id
where cms_organizationalunits_hierarchy_map.superior_orgaunit_id = sou.orgaunit_id and cms_organizationalunits_hierarchy_map.assoc_type = :assocType
join cms_orgaunits_hierarchy_map on ou.bundle_id = cms_orgaunits_hierarchy_map.subordinate_orgaunit_id
where cms_orgaunits_hierarchy_map.superior_orgaunit_id = sou.orgaunit_id and cms_orgaunits_hierarchy_map.assoc_type = :assocType
)
select orgaunit_id, orgaunit_name from subordinate_orgaunits
} map {
@ -157,7 +157,7 @@ query getIdsOfSubordinateOrgaUnitsRecursivlyWithAssocType{
}
//Gets the members of several orga units
//add a filter (organizationalunit_id = $id1 or organizationalunit_id = $id2 or ...)
//add a filter (orgaunit_id = $id1 or orgaunit_id = $id2 or ...)
//to restrict to orga units
query getIdsOfMembersOfOrgaUnits {
BigDecimal memberId;
@ -174,18 +174,18 @@ query getIdsOfMembersOfOrgaUnits {
select distinct on (cms_person_bundles.bundle_id)
cms_person_bundles.bundle_id,
cms_items.name,
cms_organizationalunits_person_map.organizationalunit_id,
cms_organizationalunits_person_map.role_name,
cms_organizationalunits_person_map.status
cms_orgaunits_person_map.orgaunit_id,
cms_orgaunits_person_map.role_name,
cms_orgaunits_person_map.status
from cms_person_bundles
join cms_organizationalunits_person_map on cms_person_bundles.bundle_id = cms_organizationalunits_person_map.person_id
join cms_orgaunits_person_map on cms_person_bundles.bundle_id = cms_orgaunits_person_map.person_id
join cms_items on cms_person_bundles.bundle_id = cms_items.item_id
where cms_organizationalunits_person_map.organizationalunit_id in :orgaunitIds
where cms_orgaunits_person_map.orgaunit_id in :orgaunitIds
} map {
memberId = cms_person_bundles.bundle_id;
orgaunitId = cms_organizationalunits_person_map.organizationalunit_id;
orgaunitId = cms_orgaunits_person_map.orgaunit_id;
name = cms_items.name;
roleName = cms_organizationalunits_person_map.role_name;
status = cms_organizationalunits_person_map.status;
roleName = cms_orgaunits_person_map.role_name;
status = cms_orgaunits_person_map.status;
}
}

View File

@ -30,8 +30,9 @@ comment on column content_types.classname is '
comment on column content_types.label is '
The pretty name for this content type
';
comment on column content_types.mode is '
Saves the mode of the content type: I = internal, H = hidden
comment on column content_types.type_mode is '
Saves the mode of the content type: I = internal, H = hidden, D = Default (a
content type used in its normal way)
An internal content type is one that is not user-defined and maintained
internally. A content type should be made internal under the following

View File

@ -29,9 +29,9 @@ create table content_types (
classname varchar(200),
ancestors varchar(2000),
descendants varchar(2000),
mode char(1) default '' not null
type_mode char(1) default '' not null
constraint content_types_mode_ck
check ( mode in ('D', 'H', 'I') ),
check ( type_mode in ('D', 'H', 'I') ),
item_form_id integer constraint content_types_form_id_fk
references bebop_components (component_id)
);

View File

@ -18,55 +18,55 @@
-- File has to be processed AFTER add_table_cms_contacts!
-- File has to be processed AFTER add_table_cms_persons!
create table cms_organizationalunits (
organizationalunit_id integer NOT NULL,
create table cms_orgaunits (
orgaunit_id integer NOT NULL,
addendum character varying(512)
);
create table cms_organizationalunits_contact_map (
organizationalunit_id integer NOT NULL,
create table cms_orgaunits_contact_map (
orgaunit_id integer NOT NULL,
contact_id integer NOT NULL,
contact_type character varying(100),
map_order integer
);
create table cms_organizationalunits_person_map (
organizationalunit_id integer NOT NULL,
create table cms_orgaunits_person_map (
orgaunit_id integer NOT NULL,
person_id integer NOT NULL,
role_name character varying(100),
status character varying(100)
);
ALTER TABLE ONLY cms_organizationalunits_contact_map
ALTER TABLE ONLY cms_orgaunits_contact_map
ADD CONSTRAINT cms_org_con_map_con_id_p_1rc4y
PRIMARY KEY (contact_id, organizationalunit_id);
PRIMARY KEY (contact_id, orgaunit_id);
ALTER TABLE ONLY cms_organizationalunits_person_map
ALTER TABLE ONLY cms_orgaunits_person_map
ADD CONSTRAINT cms_org_per_map_org_id_p_km6_m
PRIMARY KEY (person_id, organizationalunit_id);
PRIMARY KEY (person_id, orgaunit_id);
ALTER TABLE ONLY cms_organizationalunits
ALTER TABLE ONLY cms_orgaunits
ADD CONSTRAINT cms_organiz_organiz_id_p_kk8qt
PRIMARY KEY (organizationalunit_id);
PRIMARY KEY (orgaunit_id);
ALTER TABLE ONLY cms_organizationalunits_contact_map
ALTER TABLE ONLY cms_orgaunits_contact_map
ADD CONSTRAINT cms_org_con_map_con_id_f_9tm3c
FOREIGN KEY (contact_id) REFERENCES cms_contacts(contact_id);
ALTER TABLE ONLY cms_organizationalunits_contact_map
ALTER TABLE ONLY cms_orgaunits_contact_map
ADD CONSTRAINT cms_org_con_map_org_id_f_vdrnx
FOREIGN KEY (organizationalunit_id)
REFERENCES cms_organizationalunits(organizationalunit_id);
FOREIGN KEY (orgaunit_id)
REFERENCES cms_orgaunits(orgaunit_id);
ALTER TABLE ONLY cms_organizationalunits_person_map
ALTER TABLE ONLY cms_orgaunits_person_map
ADD CONSTRAINT cms_org_per_map_org_id_f_ducb2
FOREIGN KEY (organizationalunit_id)
REFERENCES cms_organizationalunits(organizationalunit_id);
FOREIGN KEY (orgaunit_id)
REFERENCES cms_orgaunits(orgaunit_id);
ALTER TABLE ONLY cms_organizationalunits_person_map
ALTER TABLE ONLY cms_orgaunits_person_map
ADD CONSTRAINT cms_org_per_map_per_id_f_hrpzh
FOREIGN KEY (person_id) REFERENCES cms_persons(person_id);
ALTER TABLE ONLY cms_organizationalunits
ALTER TABLE ONLY cms_orgaunits
ADD CONSTRAINT cms_organiz_organiz_id_f_ubliq
FOREIGN KEY (organizationalunit_id) REFERENCES cms_pages(item_id);
FOREIGN KEY (orgaunit_id) REFERENCES cms_pages(item_id);

View File

@ -33,21 +33,22 @@ alter table content_types
alter is_internal drop default ;
alter table content_types
rename column is_internal TO mode;
rename column is_internal TO type_mode;
alter table content_types
add constraint content_types_mode_ck CHECK
(("mode" = ANY (ARRAY['D'::bpchar, 'H'::bpchar, 'I'::bpchar]))) ;
(("type_mode" = ANY (ARRAY['D'::bpchar, 'H'::bpchar, 'I'::bpchar]))) ;
alter table content_types
alter mode set default '0'::bpchar ;
alter type_mode set default '0'::bpchar ;
alter table content_types
alter mode set NOT NULL ;
alter type_mode set NOT NULL ;
COMMENT ON
COLUMN content_types.mode IS '
Saves the mode of the content type: I = internal, H = hidden
COLUMN content_types.type_mode IS '
Saves the mode of the content type: I = internal, H = hidden, D = default (a
content type used in its normal way)
An internal content type is one that is not user-defined and maintained
internally. A content type should be made internal under the following

View File

@ -18,7 +18,7 @@
-- $Id: create_orgaunit_hierarchy_map.sql pboy $
CREATE TABLE cms_organizationalunits_hierarchy_map (
CREATE TABLE cms_orgaunits_hierarchy_map (
superior_orgaunit_id integer NOT NULL,
subordinate_orgaunit_id integer NOT NULL,
assoc_type character varying(128),
@ -27,16 +27,16 @@ CREATE TABLE cms_organizationalunits_hierarchy_map (
);
ALTER TABLE ONLY cms_organizationalunits_hierarchy_map
ALTER TABLE ONLY cms_orgaunits_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
ALTER TABLE ONLY cms_orgaunits_hierarchy_map
ADD CONSTRAINT cms_org_hie_map_sub_or_f_xq5is
FOREIGN KEY (subordinate_orgaunit_id)
REFERENCES cms_organizationalunits(organizationalunit_id);
REFERENCES cms_orgaunits(orgaunit_id);
ALTER TABLE ONLY cms_organizationalunits_hierarchy_map
ALTER TABLE ONLY cms_orgaunits_hierarchy_map
ADD CONSTRAINT cms_org_hie_map_sup_or_f_qchkn
FOREIGN KEY (superior_orgaunit_id)
REFERENCES cms_organizationalunits(organizationalunit_id);
REFERENCES cms_orgaunits(orgaunit_id);

View File

@ -19,16 +19,30 @@
CREATE TABLE cms_orgaunit_bundles (bundle_id integer NOT NULL);
ALTER TABLE ONLY cms_orgaunit_bundles ADD CONSTRAINT cms_orgau_bund_bund_id_p_cfjhf PRIMARY KEY (bundle_id);
ALTER TABLE ONLY cms_orgaunit_bundles
ADD CONSTRAINT cms_orgau_bund_bund_id_p_cfjhf
PRIMARY KEY (bundle_id);
ALTER TABLE cms_organizationalunits_contact_map DROP CONSTRAINT cms_org_con_map_org_id_f_vdrnx;
ALTER TABLE cms_orgaunits_contact_map
DROP CONSTRAINT cms_org_con_map_org_id_f_vdrnx;
ALTER TABLE ONLY cms_organizationalunits_contact_map ADD CONSTRAINT cms_org_con_map_org_id_f_vdrnx FOREIGN KEY (organizationalunit_id) REFERENCES cms_orgaunit_bundles(bundle_id);
ALTER TABLE ONLY cms_orgaunits_contact_map
ADD CONSTRAINT cms_org_con_map_org_id_f_vdrnx
FOREIGN KEY (orgaunit_id)
REFERENCES cms_orgaunit_bundles(bundle_id);
ALTER TABLE ONLY cms_orgaunit_bundles ADD CONSTRAINT cms_orgau_bund_bund_id_f_b64mp FOREIGN KEY (bundle_id) REFERENCES cms_bundles(bundle_id);
ALTER TABLE ONLY cms_orgaunit_bundles
ADD CONSTRAINT cms_orgau_bund_bund_id_f_b64mp
FOREIGN KEY (bundle_id) REFERENCES cms_bundles(bundle_id);
ALTER TABLE cms_organizationalunits_person_map DROP CONSTRAINT cms_org_per_map_org_id_f_ducb2;
ALTER TABLE cms_organizationalunits_person_map DROP CONSTRAINT cms_org_per_map_per_id_f_hrpzh;
ALTER TABLE cms_orgaunits_person_map
DROP CONSTRAINT cms_org_per_map_org_id_f_ducb2;
ALTER TABLE cms_orgaunits_person_map
DROP CONSTRAINT cms_org_per_map_per_id_f_hrpzh;
ALTER TABLE ONLY cms_organizationalunits_person_map ADD CONSTRAINT cms_org_per_map_org_id_f_ducb2 FOREIGN KEY (organizationalunit_id) REFERENCES cms_bundles(bundle_id);
ALTER TABLE ONLY cms_organizationalunits_person_map ADD CONSTRAINT cms_org_per_map_per_id_f_hrpzh FOREIGN KEY (person_id) REFERENCES cms_bundles(bundle_id);
ALTER TABLE ONLY cms_orgaunits_person_map
ADD CONSTRAINT cms_org_per_map_org_id_f_ducb2
FOREIGN KEY (orgaunit_id) REFERENCES cms_bundles(bundle_id);
ALTER TABLE ONLY cms_orgaunits_person_map
ADD CONSTRAINT cms_org_per_map_per_id_f_hrpzh
FOREIGN KEY (person_id) REFERENCES cms_bundles(bundle_id);

View File

@ -19,4 +19,4 @@
-- adds to personsstr column (used for filtering organization by their members)
ALTER TABLE cms_organizationalunits ADD COLUMN personsstr TEXT;
ALTER TABLE cms_orgaunits ADD COLUMN personsstr TEXT;

View File

@ -65,7 +65,8 @@
@@ default/content-section/table-authoring_kits.sql
@@ default/content-section/comment-authoring_kits.sql
@@ default/content-section/index-cms_assets_mime_type_idx.sql
@@ default/content-section/index-cms_text_pages_text_id_idx.sql
-- class TextPage removed from class hierarchy
-- @@ default/content-section/index-cms_text_pages_text_id_idx.sql
-- @@ default/content-section/table-cms_article_image_map.sql
@@ default/content-section/insert-cms_resource_types.sql
@@ default/content-section/index-cms_resources_type_idx.sql

View File

@ -65,6 +65,7 @@
\i default/content-section/table-authoring_kits.sql
\i default/content-section/comment-authoring_kits.sql
\i default/content-section/index-cms_assets_mime_type_idx.sql
-- class TextPage removed from class hierarchy
--\i default/content-section/index-cms_text_pages_text_id_idx.sql
-- \i default/content-section/table-cms_article_image_map.sql
\i default/content-section/insert-cms_resource_types.sql

View File

@ -0,0 +1,145 @@
--
-- Copyright (C) 2014 Peter Boy 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: ren_tables_cms_organisation.sql pboy $
-- Description:
-- Rename tables with names longer than 30 characters to retain Oracle compatibility
-- cms_organizationunits_* to cms_orgaunits_*
-- This update is only applicable for the scientificcms tree up to version 2.2
-- Don't use for the APLAWS tree! APLAWS is update just from 1.0.4 to 2.3.x
-- It corrects various updates
-- * 6.6.0-6.6.1/add_tables_cms_organisation.sql
-- * 6.6.3-6.6.4/create_orgaunit_hierarchy_table.sql
-- * 6.6.4-6.6.5/create_orgaunit_bundle.sql
-- * (6.6.7-6.6.8/add_personsstr_column.sql)
ALTER TABLE cms_organizationalunits
DROP CONSTRAINT cms_organiz_organiz_id_p_kk8qt;
ALTER TABLE cms_organizationalunits_contact_map
DROP CONSTRAINT cms_org_con_map_con_id_p_1rc4y;
ALTER TABLE cms_organizationalunits_person_map
DROP CONSTRAINT cms_org_per_map_org_id_p_km6_m;
ALTER TABLE cms_organizationalunits_hierarchy_map
DROP CONSTRAINT cms_org_hie_map_sub_or_p_nykpq;
ALTER TABLE cms_organizationalunits
RENAME TO cms_orgaunits ;
ALTER TABLE cms_orgaunits
RENAME column organizationalunit_id TO orgaunit_id ;
ALTER TABLE cms_organizationalunits_contact_map
RENAME TO cms_orgaunits_contact_map ;
ALTER TABLE cms_orgaunits_contact_map
RENAME column organizationalunit_id TO orgaunit_id ;
ALTER TABLE cms_organizationalunits_person_map
RENAME TO cms_orgaunits_person_map ;
ALTER TABLE cms_orgaunits_person_map
RENAME column organizationalunit_id TO orgaunit_id ;
ALTER TABLE cms_organizationalunits_hierarchy_map
RENAME TO cms_orgaunits_hierarchy_map ;
-- create table cms_orgaunits (
-- orgaunit_id integer NOT NULL,
-- addendum character varying(512)
-- );
-- create table cms_orgaunits_contact_map (
-- orgaunit_id integer NOT NULL,
-- contact_id integer NOT NULL,
-- contact_type character varying(100),
-- map_order integer
-- );
-- create table cms_orgaunits_person_map (
-- orgaunit_id integer NOT NULL,
-- person_id integer NOT NULL,
-- role_name character varying(100),
-- status character varying(100)
-- );
-- CREATE TABLE cms_orgaunits_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
-- );
ALTER TABLE ONLY cms_orgaunits_contact_map
ADD CONSTRAINT cms_org_con_map_con_id_p_1rc4y
-- PRIMARY KEY (contact_id, orgaunit_id)
;
ALTER TABLE ONLY cms_orgaunits_person_map
ADD CONSTRAINT cms_org_per_map_org_id_p_km6_m
-- PRIMARY KEY (person_id, orgaunit_id)
;
ALTER TABLE ONLY cms_orgaunits
ADD CONSTRAINT cms_organiz_organiz_id_p_kk8qt
-- PRIMARY KEY (orgaunit_id)
;
ALTER TABLE ONLY cms_orgaunits_contact_map
ADD CONSTRAINT cms_org_con_map_con_id_f_9tm3c
FOREIGN KEY (contact_id) REFERENCES cms_contacts(contact_id);
ALTER TABLE ONLY cms_orgaunits_contact_map
ADD CONSTRAINT cms_org_con_map_org_id_f_vdrnx
FOREIGN KEY (orgaunit_id)
REFERENCES cms_orgaunits(orgaunit_id);
ALTER TABLE ONLY cms_orgaunits_person_map
ADD CONSTRAINT cms_org_per_map_org_id_f_ducb2
FOREIGN KEY (orgaunit_id)
REFERENCES cms_orgaunits(orgaunit_id);
ALTER TABLE ONLY cms_orgaunits_person_map
ADD CONSTRAINT cms_org_per_map_per_id_f_hrpzh
FOREIGN KEY (person_id) REFERENCES cms_persons(person_id);
ALTER TABLE ONLY cms_orgaunits_hierarchy_map
ADD CONSTRAINT cms_org_hie_map_sub_or_p_nykpq
PRIMARY KEY (subordinate_orgaunit_id, superior_orgaunit_id);
ALTER TABLE ONLY cms_orgaunits_hierarchy_map
ADD CONSTRAINT cms_org_hie_map_sub_or_f_xq5is
FOREIGN KEY (subordinate_orgaunit_id)
REFERENCES cms_orgaunits(orgaunit_id);
ALTER TABLE ONLY cms_orgaunits_hierarchy_map
ADD CONSTRAINT cms_org_hie_map_sup_or_f_qchkn
FOREIGN KEY (superior_orgaunit_id)
REFERENCES cms_orgaunits(orgaunit_id);
ALTER TABLE ONLY cms_orgaunits
ADD CONSTRAINT cms_organiz_organiz_id_f_ubliq
FOREIGN KEY (orgaunit_id) REFERENCES cms_pages(item_id);
--
-- Check: 6.6.7-6.6.8/create_orgaunit_bundle for additional constraints

View File

@ -0,0 +1,42 @@
--
-- Copyright (C) 2014 Peter Boy 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_content_types.sql pboy $
-- This update adjusts a notify to Oracle specific restrictions (mode is
-- reserved and connot used in Oracle for an identifier, changed to type_mode)
-- There exists an Postgresql version only, because there never had been an
-- Oracle db with that identifier.
-- This update is only applicable for the scientificcms tree up to version 2.2
-- Don't use for the APLAWS tree! APLAWS is update just from 1.0.4 to 2.3.x
ALTER TABLE content_types
drop constraint content_types_mode_ck ;
ALTER TABLE content_types
rename COLUMN mode TO type_mode;
ALTER TABLE content_types
add constraint content_types_mode_ck CHECK
(("type_mode" = ANY (ARRAY['D'::bpchar, 'H'::bpchar, 'I'::bpchar]))) ;
-- Should not be necessary, rename shouldn't modify this
-- ALTER TABLE content_types
-- alter type_mode set default '0'::bpchar ;
-- ALTER TABLE content_types
-- alter type_mode set NOT NULL ;

View File

@ -0,0 +1,23 @@
--
-- Copyright (C) 2014 Peter Boy 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: oracle-se-6.6.11-6.6.12.sql pboy $
-- Update: Fixes various identifiers with could be uses in PostgreSQL but not
-- in Oracle. Therefore there is nothing to do here.
PROMPT Red Hat Enterprise CMS 6.6.11 -> 6.6.12 Upgrade Script (Oracle)

View File

@ -0,0 +1,33 @@
--
-- Copyright (C) 2014 Peter Boy 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: postgres-6.6.11-6.6.12.sql pboy $
-- Update: Fixes various identifiers with could be used in PostgreSQL but not
-- in Oracle.
-- This update is only applicable for the scientificcms tree up to 2.2
-- Don't use for the APLAWS tree. APLAWS is updated from 1.0.4
-- directly to 2.3.x (6.6.12)!
\echo Red Hat Enterprise CMS 6.6.11 -> 6.6.12 Upgrade Script (PostgreSQL)
begin;
\i ../postgres/upgrade/6.6.11-6.6.12/upd_table_content_types.sql
\i ../postgres/upgrade/6.6.11-6.6.12/upd_tables_cms_organisation.sql
commit;

View File

@ -16,12 +16,12 @@ public class CreateOrgaUnitBundles extends AbstractBundleUpgrade {
@Override
protected String getContentItemTableName() {
return "cms_organizationalunits";
return "cms_orgaunits";
}
@Override
protected String getIdColName() {
return "organizationalunit_id";
return "orgaunit_id";
}
@Override

View File

@ -12,12 +12,12 @@ public class GenericOrgaUnitGenericContactAssocUpgrade extends AbstractAssocUpgr
@Override
protected String getTableName() {
return "cms_organizationalunits_contact_map";
return "cms_orgaunits_contact_map";
}
@Override
protected String getOwnerIdCol() {
return "organizationalunit_id";
return "orgaunit_id";
}
@Override

View File

@ -12,7 +12,7 @@ public class GenericOrgaUnitGenericOrgaUnitAssocUpgrade extends AbstractAssocUpg
@Override
protected String getTableName() {
return "cms_organizationalunits_hierarchy_map";
return "cms_orgaunits_hierarchy_map";
}
@Override

View File

@ -12,12 +12,12 @@ public class GenericOrgaUnitGenericPersonAssocUpgrade extends AbstractAssocUpgra
@Override
protected String getTableName() {
return "cms_organizationalunits_person_map";
return "cms_orgaunits_person_map";
}
@Override
protected String getOwnerIdCol() {
return "organizationalunit_id";
return "orgaunit_id";
}
@Override