Index: openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql,v
diff -u -r1.16.2.8 -r1.16.2.9
--- openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql	24 Mar 2003 20:32:10 -0000	1.16.2.8
+++ openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql	4 Jul 2003 12:22:36 -0000	1.16.2.9
@@ -995,3 +995,70 @@
 
 
 -- show errors
+
+
+-- create or replace package body admin_rel
+-- function new
+select define_function_args('admin_rel__new','rel_id,rel_type;admin_rel,object_id_one,object_id_two,member_state;approved,creation_user,creation_ip');
+
+create or replace function admin_rel__new (integer,varchar,integer,integer,varchar,integer,varchar)
+returns integer as '
+declare
+  p_rel_id               alias for $1;  -- default null  
+  p_rel_type             alias for $2;  -- default ''admin_rel''
+  p_object_id_one        alias for $3;  
+  p_object_id_two        alias for $4;  
+  p_member_state      alias for $5;  -- default ''approved''
+  p_creation_user        alias for $6;  -- default null
+  p_creation_ip          alias for $7;  -- default null
+  v_rel_id               integer;       
+begin
+    v_rel_id := membership_rel__new (
+      p_rel_id,           -- rel_id
+      p_rel_type,         -- rel_type
+      p_object_id_one,    -- object_id_one
+      p_object_id_two,    -- object_id_two
+      p_member_state,     -- member_state
+      p_creation_user,    -- creation_usre
+      p_creation_ip       -- creation_ip
+    );
+
+    insert into admin_rels
+     (rel_id)
+    values
+     (v_rel_id);
+
+    return v_rel_id;
+   
+end;' language 'plpgsql';
+
+-- function new
+create or replace function admin_rel__new (integer,integer)
+returns integer as '
+declare
+  object_id_one          alias for $1;  
+  object_id_two          alias for $2;  
+begin
+    return membership_rel__new(
+        null,                  -- rel_id
+        ''admin_rel'',         -- rel_type
+        object_id_one,         -- object_id_one
+        object_id_two,         -- object_id_two
+        ''approved'',          -- member_state
+        null,                  -- creation_user
+        null                   -- creation_ip
+    );
+end;' language 'plpgsql';
+
+-- procedure delete
+create or replace function admin_rel__delete (integer)
+returns integer as '
+declare
+  rel_id                 alias for $1;  
+begin
+    PERFORM membership_rel__delete(rel_id);
+
+    return 0; 
+end;' language 'plpgsql';
+
+
