Index: openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-4.6.5-4.6.6.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-4.6.5-4.6.6.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-4.6.5-4.6.6.sql 28 Aug 2003 09:41:38 -0000 1.2 +++ openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-4.6.5-4.6.6.sql 30 Sep 2003 09:05:25 -0000 1.3 @@ -22,10 +22,18 @@ ); - +declare + v_role_exists_p integer; begin - acs_rel_type.create_role ('admin', 'Administrator', 'Administrators'); + -- dotlrn may have created the admin role already + select count(*) into v_role_exists_p + from acs_rel_roles + where role = 'admin'; + if v_role_exists_p = 0 then + acs_rel_type.create_role ('admin', 'Administrator', 'Administrators'); + end if; + acs_rel_type.create_type ( rel_type => 'admin_rel', pretty_name => 'Administrator Relation', Index: openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-4.6.5-4.6.6.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-4.6.5-4.6.6.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-4.6.5-4.6.6.sql 28 Aug 2003 09:41:39 -0000 1.2 +++ openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-4.6.5-4.6.6.sql 30 Sep 2003 09:05:25 -0000 1.3 @@ -21,9 +21,26 @@ primary key ); +-- Create the admin role if it doesn't already exist +create function inline_0 () +returns integer as ' +declare + v_role_exists_p integer; +begin + -- dotlrn may have created the admin role already + select count(*) into v_role_exists_p + from acs_rel_roles + where role = ''admin''; -select acs_rel_type__create_role ('admin', 'Administrator', 'Administrators'); + if v_role_exists_p = 0 then + select acs_rel_type__create_role (''admin'', ''Administrator'', ''Administrators''); + end if; + return 0; +end;' language 'plpgsql'; +select inline_0 (); +drop function inline_0 (); + select acs_rel_type__create_type ( 'admin_rel', -- rel_type 'Administrator Relation', -- pretty_name