diff --git a/ccm-core/pdl/com/arsdigita/messaging/Message.pdl b/ccm-core/pdl/com/arsdigita/messaging/Message.pdl index ef38780b4..4da9c23df 100755 --- a/ccm-core/pdl/com/arsdigita/messaging/Message.pdl +++ b/ccm-core/pdl/com/arsdigita/messaging/Message.pdl @@ -21,15 +21,19 @@ model com.arsdigita.messaging; import com.arsdigita.kernel.*; +// The column body is created as CLOB (Oracle) rsp. TEXT (Postgres) +// by SQL scripts and is capable to store more than 4000 characters +// [varchar(4000) below] + object type Message extends ACSObject { String[0..1] replyTo = messages.reply_to VARCHAR(250); String[1..1] subject = messages.subject VARCHAR(250); - String[1..1] body = messages.body CLOB; + String[1..1] body = messages.body VARCHAR(4000); String[1..1] type = messages.type VARCHAR(50); Date[1..1] sent = messages.sent_date TIMESTAMP; BigDecimal[0..1] inReplyTo = messages.in_reply_to INTEGER; - BigDecimal objectID = messages.object_id INTEGER; + BigDecimal objectID = messages.object_id INTEGER; String[0..1] messageID = messages.rfc_message_id VARCHAR(1000); Party[1..1] sender = join messages.sender to parties.party_id; diff --git a/ccm-core/sql/ccm-core/default/upgrade/6.5.4-6.5.5/delete-object_1_granted_context-entries.sql b/ccm-core/sql/ccm-core/default/upgrade/6.5.4-6.5.5/delete-object_1_granted_context-entries.sql index 11bd155de..bd1f78a83 100755 --- a/ccm-core/sql/ccm-core/default/upgrade/6.5.4-6.5.5/delete-object_1_granted_context-entries.sql +++ b/ccm-core/sql/ccm-core/default/upgrade/6.5.4-6.5.5/delete-object_1_granted_context-entries.sql @@ -20,4 +20,5 @@ where exists (select 1 from object_context and not exists (select 1 from acs_permissions where object_id = pd_object_id); -commit; \ No newline at end of file +commit; + diff --git a/ccm-core/sql/ccm-core/oracle-se-create.sql b/ccm-core/sql/ccm-core/oracle-se-create.sql index a9b2163f9..39f9130fa 100755 --- a/ccm-core/sql/ccm-core/oracle-se-create.sql +++ b/ccm-core/sql/ccm-core/oracle-se-create.sql @@ -22,6 +22,8 @@ @@ ddl/oracle-se/create.sql + + @@ default/globalization/table-g11n_charsets.sql @@ default/globalization/index-g11n_charsets.sql @@ default/globalization/table-g11n_locales.sql diff --git a/ccm-core/sql/ccm-core/oracle-se/messaging/table-messages.sql b/ccm-core/sql/ccm-core/oracle-se/messaging/table-messages.sql index c809f06af..93aade6e2 100755 --- a/ccm-core/sql/ccm-core/oracle-se/messaging/table-messages.sql +++ b/ccm-core/sql/ccm-core/oracle-se/messaging/table-messages.sql @@ -33,7 +33,7 @@ create table messages ( references parties (party_id), subject varchar(250) constraint messages_subject_nn not null, - body varchar(4000) + body clob constraint messages_body_nn not null, type varchar(50) constraint messages_type_nn not null, diff --git a/ccm-core/sql/ccm-core/oracle-se/upgrade/6.5.5-6.5.6/create-category_localizations-table.sql b/ccm-core/sql/ccm-core/oracle-se/upgrade/6.5.5-6.5.6/create-category_localizations-table.sql new file mode 100755 index 000000000..1521cecb3 --- /dev/null +++ b/ccm-core/sql/ccm-core/oracle-se/upgrade/6.5.5-6.5.6/create-category_localizations-table.sql @@ -0,0 +1,38 @@ +-- +-- Copyright (C) 2008 pb@zes.uni-bremen.de 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 +-- + +CREATE TABLE cat_category_localizations ( + id integer NOT NULL, + locale character(2) NOT NULL, + description character varying(4000), + name character varying(200) NOT NULL, + url character varying(200), + enabled_p character(1) NOT NULL, + category_id integer NOT NULL +); + +ALTER TABLE ONLY cat_category_localizations + ADD CONSTRAINT cat_cate_localizati_id_p_ancqs PRIMARY KEY (id); + +ALTER TABLE ONLY cat_category_localizations + ADD CONSTRAINT cat_cat_localiz_cat_id_f_ykbad FOREIGN KEY (category_id) REFERENCES cat_categories(category_id); + +ALTER TABLE ONLY cat_category_localizations + ADD CONSTRAINT cat_cate_localizati_id_f__leq0 FOREIGN KEY (id) REFERENCES acs_objects(object_id); + + diff --git a/ccm-core/sql/ccm-core/postgres-create.sql b/ccm-core/sql/ccm-core/postgres-create.sql index 644c0d9c0..2ec765bd4 100755 --- a/ccm-core/sql/ccm-core/postgres-create.sql +++ b/ccm-core/sql/ccm-core/postgres-create.sql @@ -25,6 +25,9 @@ begin; \i default/function-currentDate.sql \i ddl/postgres/create.sql + + + \i default/globalization/table-g11n_charsets.sql \i default/globalization/index-g11n_charsets.sql \i default/globalization/table-g11n_locales.sql @@ -142,7 +145,7 @@ begin; \i default/auditing/table-acs_auditing.sql \i default/auditing/index-acs_auditing.sql -\i default/messaging/table-messages.sql +\i postgres/messaging/table-messages.sql \i default/messaging/index-messages.sql \i default/messaging/comment-messages.sql \i postgres/messaging/table-message_parts.sql diff --git a/ccm-core/sql/ccm-core/default/messaging/table-messages.sql b/ccm-core/sql/ccm-core/postgres/messaging/table-messages.sql old mode 100755 new mode 100644 similarity index 94% rename from ccm-core/sql/ccm-core/default/messaging/table-messages.sql rename to ccm-core/sql/ccm-core/postgres/messaging/table-messages.sql index 241ee1325..df254243b --- a/ccm-core/sql/ccm-core/default/messaging/table-messages.sql +++ b/ccm-core/sql/ccm-core/postgres/messaging/table-messages.sql @@ -15,8 +15,8 @@ -- 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: table-messages.sql 287 2005-02-22 00:29:02Z sskracic $ --- $DateTime: 2004/08/16 18:10:38 $ +-- $Id: table-messages.sql 287 2008-06-07 00:29:02Z pboy $ +-- $DateTime: 2008/06/07 18:10:38 $ create table messages ( message_id integer @@ -33,7 +33,7 @@ create table messages ( references parties (party_id), subject varchar(250) constraint messages_subject_nn not null, - body varchar(4000) + body text constraint messages_body_nn not null, type varchar(50) constraint messages_type_nn not null, diff --git a/ccm-core/sql/ccm-core/postgres/upgrade/6.5.2-6.5.3/clob_message.sql b/ccm-core/sql/ccm-core/postgres/upgrade/6.5.2-6.5.3/clob_message.sql index e14ebdf8b..872ee77a1 100755 --- a/ccm-core/sql/ccm-core/postgres/upgrade/6.5.2-6.5.3/clob_message.sql +++ b/ccm-core/sql/ccm-core/postgres/upgrade/6.5.2-6.5.3/clob_message.sql @@ -19,7 +19,7 @@ -alter table messages add large_body text; +alter table messages add large_body text NOT NULL; update messages set large_body = body; @@ -27,13 +27,22 @@ alter table messages drop column body; alter table messages rename column large_body to body; + +COMMENT ON COLUMN messages.body IS ' + Body of the message. +'; + commit; + -- reclaim disk space from old column UPDATE messages SET body = body; -VACUUM FULL messages; +-- VACUUM can not be executed inside a transaction block. (Doesn't matter +-- whether before or after the commit; is a transaction block anyway!) +-- Should be performed after update has finished. +-- VACUUM FULL messages; commit; diff --git a/ccm-core/sql/ccm-core/postgres/upgrade/6.5.5-6.5.6/create-category_localizations-table.sql b/ccm-core/sql/ccm-core/postgres/upgrade/6.5.5-6.5.6/create-category_localizations-table.sql new file mode 100644 index 000000000..1521cecb3 --- /dev/null +++ b/ccm-core/sql/ccm-core/postgres/upgrade/6.5.5-6.5.6/create-category_localizations-table.sql @@ -0,0 +1,38 @@ +-- +-- Copyright (C) 2008 pb@zes.uni-bremen.de 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 +-- + +CREATE TABLE cat_category_localizations ( + id integer NOT NULL, + locale character(2) NOT NULL, + description character varying(4000), + name character varying(200) NOT NULL, + url character varying(200), + enabled_p character(1) NOT NULL, + category_id integer NOT NULL +); + +ALTER TABLE ONLY cat_category_localizations + ADD CONSTRAINT cat_cate_localizati_id_p_ancqs PRIMARY KEY (id); + +ALTER TABLE ONLY cat_category_localizations + ADD CONSTRAINT cat_cat_localiz_cat_id_f_ykbad FOREIGN KEY (category_id) REFERENCES cat_categories(category_id); + +ALTER TABLE ONLY cat_category_localizations + ADD CONSTRAINT cat_cate_localizati_id_f__leq0 FOREIGN KEY (id) REFERENCES acs_objects(object_id); + + diff --git a/ccm-core/sql/ccm-core/upgrade/oracle-se-6.5.5-6.5.6.sql b/ccm-core/sql/ccm-core/upgrade/oracle-se-6.5.5-6.5.6.sql new file mode 100755 index 000000000..0a2ada935 --- /dev/null +++ b/ccm-core/sql/ccm-core/upgrade/oracle-se-6.5.5-6.5.6.sql @@ -0,0 +1,22 @@ +-- +-- Copyright (C) 2008 pb@zes.uni-bremen.de 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 +-- + +PROMPT ccm-core 6.5.5 -> 6.5.6 Upgrade Script (Oracle) + +@@ ../oracle-se/upgrade/6.5.5-6.5.6/create-category_localizations-table.sql + diff --git a/ccm-core/sql/ccm-core/upgrade/postgres-6.5.3-6.5.4.sql b/ccm-core/sql/ccm-core/upgrade/postgres-6.5.3-6.5.4.sql index 43d2e0c95..589089098 100755 --- a/ccm-core/sql/ccm-core/upgrade/postgres-6.5.3-6.5.4.sql +++ b/ccm-core/sql/ccm-core/upgrade/postgres-6.5.3-6.5.4.sql @@ -16,7 +16,7 @@ -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -\echo Red Hat WAF 6.5.3 -> 6.5.4 Upgrade Script (PostgreSQL) +\echo ccm-core 6.5.3 -> 6.5.4 Upgrade Script (PostgreSQL) begin; diff --git a/ccm-core/sql/ccm-core/upgrade/postgres-6.5.4-6.5.5.sql b/ccm-core/sql/ccm-core/upgrade/postgres-6.5.4-6.5.5.sql index c4d68241e..0fd10e652 100755 --- a/ccm-core/sql/ccm-core/upgrade/postgres-6.5.4-6.5.5.sql +++ b/ccm-core/sql/ccm-core/upgrade/postgres-6.5.4-6.5.5.sql @@ -16,6 +16,7 @@ -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -\echo Red Hat WAF 6.5.4 -> 6.5.5 Upgrade Script (PostgreSQL) +\echo ccm-core 6.5.4 -> 6.5.5 Upgrade Script (PostgreSQL) --- nothing doing, unless someone updates ctx triggers for postgres \ No newline at end of file +-- nothing doing, unless someone updates ctx triggers for postgres +; diff --git a/ccm-core/sql/ccm-core/upgrade/postgres-6.5.5-6.5.6.sql b/ccm-core/sql/ccm-core/upgrade/postgres-6.5.5-6.5.6.sql new file mode 100644 index 000000000..353ae240c --- /dev/null +++ b/ccm-core/sql/ccm-core/upgrade/postgres-6.5.5-6.5.6.sql @@ -0,0 +1,26 @@ +-- +-- Copyright (C) 2008 pb@zes.uni-bremen.de 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 +-- +\echo ccm-core 6.5.5 -> 6.5.6 Upgrade Script (PostgreSQL) + +begin; + + +\i ../postgres/upgrade/6.5.5-6.5.6/create-category_localizations-table.sql + + +commit; diff --git a/ccm-core/src/ccm-core.upgrade b/ccm-core/src/ccm-core.upgrade index 6dec2dd2e..1e2ef05e0 100755 --- a/ccm-core/src/ccm-core.upgrade +++ b/ccm-core/src/ccm-core.upgrade @@ -31,4 +31,7 @@