Fixed upgrade ccm-core-6.6.0-6.6.1 to make upgrade compatible with Oracle. Upgrade has now a variant for PostgreSQL and one for Oracle.

git-svn-id: https://svn.libreccm.org/ccm/trunk@3029 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-12-10 11:14:55 +00:00
parent f55df351b5
commit 191e09f3e1
5 changed files with 72 additions and 32 deletions

View File

@ -20,4 +20,4 @@
PROMPT Red Hat Enterprise CORE 6.6.0 -> 6.6.1 Upgrade Script (Oracle) 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/drop_tables_acs_stylesheets.sql
@@ default/6.6.0-6.6.1/recreate_users_index.sql @@ oracle-se/6.6.0-6.6.1/recreate_users_index.sql

View File

@ -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));

View File

@ -22,6 +22,6 @@
begin; begin;
\i default/6.6.0-6.6.1/drop_tables_acs_stylesheets.sql \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; commit;

View File

@ -44,40 +44,43 @@ ALTER TABLE init_requirements
REFERENCES inits (class_name); REFERENCES inits (class_name);
update application_types UPDATE application_types
set (object_type,title,description)= SET object_type = REPLACE(object_type,'london.rss.RSS', 'rssfeed.RSSFeed',
(replace(object_type,'london.rss.RSS', 'rssfeed.RSSFeed'), title = 'RSS Feed',
'RSS Feed', description = 'Provides RSS feed service'
'Provides RSS feed service') WHERE object_type LIKE '%london.rss.RSS%';
where object_type like '%london.rss.RSS%' ;
-- table applications requires an update -- table applications requires an update
update applications UPDATE applications
set (title,description)=('RSS Feeds','RSS feed channels') SET title = 'RSS Feeds',
where primary_url like '%channels%' ; description = 'RSS Feed channels'
WHERE primary_url LIKE '%channels%';
-- update acs_objects -- update acs_objects
-- (a) update application type -- (a) update application type
update acs_objects UPDATE acs_objects
set (object_type,display_name,default_domain_class) = SET object_type = REPLACE(object_type,'london.rss.RSS', 'rssfeed.RSSFeed'),
(replace(object_type,'london.rss.RSS', 'rssfeed.RSSFeed') , display_name = 'RSS Service',
'RSS Service', default_domain_class = REPLACE(default_domain_class,'london.rss.RSS', 'rssfeed.RSSFeed')
replace(default_domain_class,'london.rss.RSS', 'rssfeed.RSSFeed') ) WHERE object_type LIKE '%london.rss.RSS%' ;
where object_type like '%london.rss.RSS%' ;
-- (b) update feeds -- (b) update feeds
update acs_objects UPDATE acs_objects
set (object_type,display_name,default_domain_class) = SET object_type = REPLACE(object_type,'london.rss', 'rssfeed'),
(replace(object_type,'london.rss', 'rssfeed') , display_name = REPLACE(display_name,'london.rss','rssfeed'),
replace(display_name,'london.rss','rssfeed'), default_domain_class = REPLACE(default_domain_class,'london.rss', 'rssfeed')
replace(default_domain_class,'london.rss', 'rssfeed') ) WHERE object_type LIKE '%london.rss.Feed%' ;
where object_type like '%london.rss.Feed%' ;
-- (c) remove unused RSS cat purpose -- (c) remove unused RSS cat purpose
update acs_objects UPDATE acs_objects
set display_name = 'RSS cat purpose to delete' SET display_name = 'RSS cat purpose to delete'
where object_id = (select purpose_id from cat_purposes WHERE object_id = (SELECT purpose_id FROM cat_purposes
where key like '%RSS%'); 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 DELETE FROM cat_purposes WHERE key LIKE '%RSS%';
where display_name like
'RSS cat purpose to delete') ; DELETE FROM object_context WHERE object_id = (SELECT object_id
delete from acs_objects where display_name like 'RSS cat purpose to delete' ; 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' ;