diff --git a/ccm-core/sql/ccm-core/upgrade/oracle-se-6.6.0-6.6.1.sql b/ccm-core/sql/ccm-core/upgrade/oracle-se-6.6.0-6.6.1.sql index 90be901cc..cb570abb8 100644 --- a/ccm-core/sql/ccm-core/upgrade/oracle-se-6.6.0-6.6.1.sql +++ b/ccm-core/sql/ccm-core/upgrade/oracle-se-6.6.0-6.6.1.sql @@ -20,4 +20,4 @@ PROMPT Red Hat Enterprise CORE 6.6.0 -> 6.6.1 Upgrade Script (Oracle) @@ default/6.6.0-6.6.1/drop_tables_acs_stylesheets.sql -@@ default/6.6.0-6.6.1/recreate_users_index.sql \ No newline at end of file +@@ oracle-se/6.6.0-6.6.1/recreate_users_index.sql \ No newline at end of file diff --git a/ccm-core/sql/ccm-core/upgrade/oracle-se/6.6.0-6.6.1/recreate_users_index.sql b/ccm-core/sql/ccm-core/upgrade/oracle-se/6.6.0-6.6.1/recreate_users_index.sql new file mode 100644 index 000000000..fd0c3efa1 --- /dev/null +++ b/ccm-core/sql/ccm-core/upgrade/oracle-se/6.6.0-6.6.1/recreate_users_index.sql @@ -0,0 +1,37 @@ +-- +-- 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: recreateusers_index.sql pboy $ + +-- for some unkown reason for some ccm installations an index for +-- users tables has been lost. Just in case it is recreated here. + +-- For Oracle some magic is necessary. Thanks to James Li at Camden for providing the commands +-- below. + +CREATE OR REPLACE PROCEDURE DROP_INDEX_IF_EXISTS(INDEX_NAME IN VARCHAR2) AS +BEGIN + EXECUTE IMMEDIATE 'drop index ' || upper(INDEX_NAME); +EXCEPTION + WHEN OTHERS THEN + NULL; +END DROP_INDEX_IF_EXISTS; + +-- First: Drop index to avoid an error if it already exists + +drop_index_if_exists('users_lower_screen_name_idx') ; + +create unique index users_lower_screen_name_idx on users + USING btree (lower((screen_name)::text)); \ No newline at end of file diff --git a/ccm-core/sql/ccm-core/upgrade/postgres-6.6.0-6.6.1.sql b/ccm-core/sql/ccm-core/upgrade/postgres-6.6.0-6.6.1.sql index 73bed866e..e1daea23a 100644 --- a/ccm-core/sql/ccm-core/upgrade/postgres-6.6.0-6.6.1.sql +++ b/ccm-core/sql/ccm-core/upgrade/postgres-6.6.0-6.6.1.sql @@ -22,6 +22,6 @@ begin; \i default/6.6.0-6.6.1/drop_tables_acs_stylesheets.sql -\i default/6.6.0-6.6.1/recreate_users_index.sql +\i postgres/6.6.0-6.6.1/recreate_users_index.sql commit; diff --git a/ccm-core/sql/ccm-core/upgrade/default/6.6.0-6.6.1/recreate_users_index.sql b/ccm-core/sql/ccm-core/upgrade/postgres/6.6.0-6.6.1/recreate_users_index.sql similarity index 100% rename from ccm-core/sql/ccm-core/upgrade/default/6.6.0-6.6.1/recreate_users_index.sql rename to ccm-core/sql/ccm-core/upgrade/postgres/6.6.0-6.6.1/recreate_users_index.sql diff --git a/ccm-rssfeed/sql/ccm-rssfeed/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql b/ccm-rssfeed/sql/ccm-rssfeed/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql index 23b737332..90040dc39 100644 --- a/ccm-rssfeed/sql/ccm-rssfeed/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql +++ b/ccm-rssfeed/sql/ccm-rssfeed/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql @@ -44,40 +44,43 @@ ALTER TABLE init_requirements REFERENCES inits (class_name); -update application_types - set (object_type,title,description)= - (replace(object_type,'london.rss.RSS', 'rssfeed.RSSFeed'), - 'RSS Feed', - 'Provides RSS feed service') - where object_type like '%london.rss.RSS%' ; +UPDATE application_types + SET object_type = REPLACE(object_type,'london.rss.RSS', 'rssfeed.RSSFeed', + title = 'RSS Feed', + description = 'Provides RSS feed service' + WHERE object_type LIKE '%london.rss.RSS%'; -- table applications requires an update -update applications - set (title,description)=('RSS Feeds','RSS feed channels') - where primary_url like '%channels%' ; +UPDATE applications + SET title = 'RSS Feeds', + description = 'RSS Feed channels' + WHERE primary_url LIKE '%channels%'; -- update acs_objects -- (a) update application type -update acs_objects - set (object_type,display_name,default_domain_class) = - (replace(object_type,'london.rss.RSS', 'rssfeed.RSSFeed') , - 'RSS Service', - replace(default_domain_class,'london.rss.RSS', 'rssfeed.RSSFeed') ) - where object_type like '%london.rss.RSS%' ; +UPDATE acs_objects + SET object_type = REPLACE(object_type,'london.rss.RSS', 'rssfeed.RSSFeed'), + display_name = 'RSS Service', + default_domain_class = REPLACE(default_domain_class,'london.rss.RSS', 'rssfeed.RSSFeed') + WHERE object_type LIKE '%london.rss.RSS%' ; + -- (b) update feeds -update acs_objects - set (object_type,display_name,default_domain_class) = - (replace(object_type,'london.rss', 'rssfeed') , - replace(display_name,'london.rss','rssfeed'), - replace(default_domain_class,'london.rss', 'rssfeed') ) - where object_type like '%london.rss.Feed%' ; +UPDATE acs_objects + SET object_type = REPLACE(object_type,'london.rss', 'rssfeed'), + display_name = REPLACE(display_name,'london.rss','rssfeed'), + default_domain_class = REPLACE(default_domain_class,'london.rss', 'rssfeed') + WHERE object_type LIKE '%london.rss.Feed%' ; + -- (c) remove unused RSS cat purpose -update acs_objects - set display_name = 'RSS cat purpose to delete' - where object_id = (select purpose_id from cat_purposes - where key like '%RSS%'); -delete from cat_purposes where key like '%RSS%' ; -delete from object_context where object_id = (select object_id from acs_objects - where display_name like - 'RSS cat purpose to delete') ; -delete from acs_objects where display_name like 'RSS cat purpose to delete' ; +UPDATE acs_objects + SET display_name = 'RSS cat purpose to delete' + WHERE object_id = (SELECT purpose_id FROM cat_purposes + WHERE key LIKE '%RSS%'); + +DELETE FROM cat_purposes WHERE key LIKE '%RSS%'; + +DELETE FROM object_context WHERE object_id = (SELECT object_id + FROM acs_objects + WHERE display_name LIKE 'RSS cat purpose to delete'); + +DELETE FROM acs_objects WHERE display_name LIKE 'RSS cat purpose to delete' ;