Index: openacs-4/packages/fs-portlet/sql/postgresql/upgrade/upgrade-2.0.3-2.0.4.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/sql/postgresql/upgrade/upgrade-2.0.3-2.0.4.sql,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/fs-portlet/sql/postgresql/upgrade/upgrade-2.0.3-2.0.4.sql 20 Jul 2004 00:05:50 -0000 1.1.2.2 +++ openacs-4/packages/fs-portlet/sql/postgresql/upgrade/upgrade-2.0.3-2.0.4.sql 7 Sep 2004 15:28:01 -0000 1.1.2.3 @@ -5,31 +5,36 @@ -- fs_contents_portlets get renamed properly. -- -create or replace trigger fs_cont_port_fldr_rnme_tr -after update on cr_folders -for each row +--create or replace trigger fs_cont_port_fldr_rnme_tr +--after update on cr_folders +--for each row + +create or replace function fold_rename() returns trigger as ' +declare + row_res record; begin if :old.label <> :new.label then - - for row in (select m.element_id + for row_res in select m.element_id from portal_element_map m, portal_element_parameters p - where p.key = 'folder_id' + where p.key = "folder_id" and p.value = :new.folder_id and m.element_id = p.element_id - and m.name = 'fs_contents_portlet') loop + and m.name = "fs_contents_portlet" loop update portal_element_map set pretty_name = :new.label - where element_id = row.element_id; + where element_id = row_res.element_id; end loop; - end if; +return new; +end; ' language 'plpgsql'; -end fs_cont_port_fldr_rnme_tr; -/ -show errors +create trigger fs_cont_port_fldr_rnme_tr +after update on cr_folders for each row +execute procedure fold_rename(); +-- drop function fold_rename(); \i ../fs-admin-portlet-create.sql \ No newline at end of file