diff --git a/ccm-cms/application.xml b/ccm-cms/application.xml index 059df3885..b3d8e9eb6 100755 --- a/ccm-cms/application.xml +++ b/ccm-cms/application.xml @@ -2,7 +2,7 @@ diff --git a/ccm-cms/pdl/com/arsdigita/content-section/ContentType.pdl b/ccm-cms/pdl/com/arsdigita/content-section/ContentType.pdl index 8e6826bf9..27eb57ee1 100755 --- a/ccm-cms/pdl/com/arsdigita/content-section/ContentType.pdl +++ b/ccm-cms/pdl/com/arsdigita/content-section/ContentType.pdl @@ -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; diff --git a/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl b/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl index 2b5d8ab22..2d691e344 100644 --- a/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl +++ b/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl @@ -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; } } diff --git a/ccm-cms/sql/ccm-cms/default/content-section/comment-content_types.sql b/ccm-cms/sql/ccm-cms/default/content-section/comment-content_types.sql index 532997775..1d47f46e5 100755 --- a/ccm-cms/sql/ccm-cms/default/content-section/comment-content_types.sql +++ b/ccm-cms/sql/ccm-cms/default/content-section/comment-content_types.sql @@ -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 diff --git a/ccm-cms/sql/ccm-cms/default/content-section/table-content_types.sql b/ccm-cms/sql/ccm-cms/default/content-section/table-content_types.sql index bf016c809..a96903217 100755 --- a/ccm-cms/sql/ccm-cms/default/content-section/table-content_types.sql +++ b/ccm-cms/sql/ccm-cms/default/content-section/table-content_types.sql @@ -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) ); diff --git a/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/add_tables_cms_organisation.sql b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/add_tables_cms_organisation.sql index 2871569f8..12d1a384b 100644 --- a/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/add_tables_cms_organisation.sql +++ b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/add_tables_cms_organisation.sql @@ -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); \ No newline at end of file + FOREIGN KEY (orgaunit_id) REFERENCES cms_pages(item_id); \ No newline at end of file diff --git a/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/upd_table_content_types.sql b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/upd_table_content_types.sql index cf83a38b6..9240a7150 100644 --- a/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/upd_table_content_types.sql +++ b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/upd_table_content_types.sql @@ -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 diff --git a/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_orgaunit_hierarchy_table.sql b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_orgaunit_hierarchy_table.sql index 82801cfbe..8f60b0c4f 100644 --- a/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_orgaunit_hierarchy_table.sql +++ b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_orgaunit_hierarchy_table.sql @@ -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); \ No newline at end of file + REFERENCES cms_orgaunits(orgaunit_id); \ No newline at end of file diff --git a/ccm-cms/sql/ccm-cms/default/upgrade/6.6.4-6.6.5/create_orgaunit_bundle.sql b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.4-6.6.5/create_orgaunit_bundle.sql index 45935820a..f446fd55c 100644 --- a/ccm-cms/sql/ccm-cms/default/upgrade/6.6.4-6.6.5/create_orgaunit_bundle.sql +++ b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.4-6.6.5/create_orgaunit_bundle.sql @@ -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); diff --git a/ccm-cms/sql/ccm-cms/default/upgrade/6.6.7-6.6.8/add_personsstr_column.sql b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.7-6.6.8/add_personsstr_column.sql index 36290cd4d..923faa814 100644 --- a/ccm-cms/sql/ccm-cms/default/upgrade/6.6.7-6.6.8/add_personsstr_column.sql +++ b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.7-6.6.8/add_personsstr_column.sql @@ -19,4 +19,4 @@ -- adds to personsstr column (used for filtering organization by their members) -ALTER TABLE cms_organizationalunits ADD COLUMN personsstr TEXT; \ No newline at end of file +ALTER TABLE cms_orgaunits ADD COLUMN personsstr TEXT; \ No newline at end of file diff --git a/ccm-cms/sql/ccm-cms/oracle-se-create.sql b/ccm-cms/sql/ccm-cms/oracle-se-create.sql index 0ceeebe6a..c0dda6c29 100755 --- a/ccm-cms/sql/ccm-cms/oracle-se-create.sql +++ b/ccm-cms/sql/ccm-cms/oracle-se-create.sql @@ -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 diff --git a/ccm-cms/sql/ccm-cms/postgres-create.sql b/ccm-cms/sql/ccm-cms/postgres-create.sql index ed3a8f59f..019acfd73 100755 --- a/ccm-cms/sql/ccm-cms/postgres-create.sql +++ b/ccm-cms/sql/ccm-cms/postgres-create.sql @@ -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 diff --git a/ccm-cms/sql/ccm-cms/postgres/upgrade/6.6.11-6.6.12/ren_tables_cms_organisation.sql b/ccm-cms/sql/ccm-cms/postgres/upgrade/6.6.11-6.6.12/ren_tables_cms_organisation.sql new file mode 100644 index 000000000..b17201ee3 --- /dev/null +++ b/ccm-cms/sql/ccm-cms/postgres/upgrade/6.6.11-6.6.12/ren_tables_cms_organisation.sql @@ -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 \ No newline at end of file diff --git a/ccm-cms/sql/ccm-cms/postgres/upgrade/6.6.11-6.6.12/upd_table_content_types.sql b/ccm-cms/sql/ccm-cms/postgres/upgrade/6.6.11-6.6.12/upd_table_content_types.sql new file mode 100644 index 000000000..1d874fd2e --- /dev/null +++ b/ccm-cms/sql/ccm-cms/postgres/upgrade/6.6.11-6.6.12/upd_table_content_types.sql @@ -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 ; diff --git a/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.11-6.6.12.sql b/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.11-6.6.12.sql new file mode 100644 index 000000000..d048ebbc4 --- /dev/null +++ b/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.11-6.6.12.sql @@ -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) + diff --git a/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.11-6.6.12.sql b/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.11-6.6.12.sql new file mode 100644 index 000000000..e845ae98e --- /dev/null +++ b/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.11-6.6.12.sql @@ -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; diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/CreateOrgaUnitBundles.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/CreateOrgaUnitBundles.java index aeca81848..1b8f8ae11 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/CreateOrgaUnitBundles.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/CreateOrgaUnitBundles.java @@ -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 diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/GenericOrgaUnitGenericContactAssocUpgrade.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/GenericOrgaUnitGenericContactAssocUpgrade.java index bbfa871bd..7f0a8bf38 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/GenericOrgaUnitGenericContactAssocUpgrade.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/GenericOrgaUnitGenericContactAssocUpgrade.java @@ -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 diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/GenericOrgaUnitGenericOrgaUnitAssocUpgrade.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/GenericOrgaUnitGenericOrgaUnitAssocUpgrade.java index ee425ccea..8d7fea22f 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/GenericOrgaUnitGenericOrgaUnitAssocUpgrade.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/GenericOrgaUnitGenericOrgaUnitAssocUpgrade.java @@ -12,7 +12,7 @@ public class GenericOrgaUnitGenericOrgaUnitAssocUpgrade extends AbstractAssocUpg @Override protected String getTableName() { - return "cms_organizationalunits_hierarchy_map"; + return "cms_orgaunits_hierarchy_map"; } @Override diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/GenericOrgaUnitGenericPersonAssocUpgrade.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/GenericOrgaUnitGenericPersonAssocUpgrade.java index 0f9e108b7..70f02c522 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/GenericOrgaUnitGenericPersonAssocUpgrade.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/GenericOrgaUnitGenericPersonAssocUpgrade.java @@ -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