From 4943b6a3ebbd7e06ef8ccff055c00c22e9c62d1c Mon Sep 17 00:00:00 2001 From: jensp Date: Fri, 12 Dec 2014 11:19:40 +0000 Subject: [PATCH] Fixed some more syntax differences between Oracle and PostgreSQL in ccm-cms-6.6.0-6.6.1 git-svn-id: https://svn.libreccm.org/ccm/trunk@3039 8810af33-2d31-482b-a856-94f89814c4df --- .../6.6.0-6.6.1/upd_table_content_types.sql | 63 +++++++++++++++++++ .../6.6.0-6.6.1/upd_table_content_types.sql | 5 +- .../ccm-cms/upgrade/oracle-se-6.6.0-6.6.1.sql | 2 +- .../ccm-cms/upgrade/postgres-6.6.0-6.6.1.sql | 2 +- 4 files changed, 67 insertions(+), 5 deletions(-) create mode 100644 ccm-cms/sql/ccm-cms/oracle-se/upgrade/6.6.0-6.6.1/upd_table_content_types.sql rename ccm-cms/sql/ccm-cms/{default => postgres}/upgrade/6.6.0-6.6.1/upd_table_content_types.sql (94%) diff --git a/ccm-cms/sql/ccm-cms/oracle-se/upgrade/6.6.0-6.6.1/upd_table_content_types.sql b/ccm-cms/sql/ccm-cms/oracle-se/upgrade/6.6.0-6.6.1/upd_table_content_types.sql new file mode 100644 index 000000000..5515dc037 --- /dev/null +++ b/ccm-cms/sql/ccm-cms/oracle-se/upgrade/6.6.0-6.6.1/upd_table_content_types.sql @@ -0,0 +1,63 @@ +-- +-- 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 $ + +alter table content_types + drop constraint content_types_is_internal_ck ; + +alter table content_types add ancestors character varying(2000); +alter table content_types add descendants character varying(2000) ; + + +update content_types + set is_internal = 'D' where is_internal like '0' ; + +update content_types + set is_internal = 'I' where is_internal like '1' ; + +alter table content_types + modify is_internal default null; + +alter table content_types + rename column is_internal TO type_mode; + +alter table content_types + add constraint content_types_mode_ck CHECK + (("type_mode" = ANY (ARRAY['D'::bpchar, 'H'::bpchar, 'I'::bpchar]))) ; + +alter table content_types + modify type_mode set default '0'::bpchar ; + +alter table content_types + modify type_mode set NOT NULL ; + +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 + two conditions: + 1) The object type needs to take advantage of content type services + (i.e., versioning, categorization, lifecycle, workflow) that are already + implemented in CMS. + 2) The content type cannot be explicitly registered to a content section. + The Template content type is one such internal content type. + + A hidden content type is one that cannot be used directly but other content + types can extend from it. Also, it is a legit parent for UDCTs. +'; 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/postgres/upgrade/6.6.0-6.6.1/upd_table_content_types.sql similarity index 94% rename from ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/upd_table_content_types.sql rename to ccm-cms/sql/ccm-cms/postgres/upgrade/6.6.0-6.6.1/upd_table_content_types.sql index ff407a579..3b62825a7 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/postgres/upgrade/6.6.0-6.6.1/upd_table_content_types.sql @@ -18,9 +18,8 @@ alter table content_types drop constraint content_types_is_internal_ck ; -alter table content_types - add ancestors character varying(2000), - add descendants character varying(2000) ; +alter table content_types add ancestors character varying(2000); +alter table content_types add descendants character varying(2000) ; update content_types diff --git a/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.0-6.6.1.sql b/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.0-6.6.1.sql index 0c9368419..551f7fe5b 100644 --- a/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.0-6.6.1.sql +++ b/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.0-6.6.1.sql @@ -26,7 +26,7 @@ PROMPT Red Hat Enterprise CMS 6.6.0 -> 6.6.1 Upgrade Script (Oracle) @@ ../default/upgrade/6.6.0-6.6.1/add_table_cms_rel_attr.sql @@ ../oracle-se/upgrade/6.6.0-6.6.1/upd_table_cms_publ_links.sql @@ ../default/upgrade/6.6.0-6.6.1/upd_table_cms_rel_links.sql -@@ ../default/upgrade/6.6.0-6.6.1/upd_table_content_types.sql +@@ ../oracle-se/upgrade/6.6.0-6.6.1/upd_table_content_types.sql @@ ../default/upgrade/6.6.0-6.6.1/drop_table_cms_article_image_map.sql @@ ../default/upgrade/6.6.0-6.6.1/upd_table_cms_articles.sql @@ ../default/upgrade/6.6.0-6.6.1/upd_table_authoring_steps.sql diff --git a/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.0-6.6.1.sql b/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.0-6.6.1.sql index f13a21036..8cf8a8815 100644 --- a/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.0-6.6.1.sql +++ b/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.0-6.6.1.sql @@ -28,7 +28,7 @@ begin; \i ../default/upgrade/6.6.0-6.6.1/add_table_cms_rel_attr.sql \i ../postgres/upgrade/6.6.0-6.6.1/upd_table_cms_publ_links.sql \i ../default/upgrade/6.6.0-6.6.1/upd_table_cms_rel_links.sql -\i ../default/upgrade/6.6.0-6.6.1/upd_table_content_types.sql +\i ../postgres/upgrade/6.6.0-6.6.1/upd_table_content_types.sql \i ../default/upgrade/6.6.0-6.6.1/drop_table_cms_article_image_map.sql \i ../default/upgrade/6.6.0-6.6.1/upd_table_cms_articles.sql \i ../default/upgrade/6.6.0-6.6.1/upd_table_authoring_steps.sql