Index: openacs-4/packages/acs-kernel/sql/oracle/acs-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/acs-create.sql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-kernel/sql/oracle/acs-create.sql	7 Jun 2002 04:32:21 -0000	1.3
+++ openacs-4/packages/acs-kernel/sql/oracle/acs-create.sql	18 Feb 2003 20:53:43 -0000	1.4
@@ -193,13 +193,13 @@
   root_id integer;
 begin
   root_id := acs_object.new (
-    object_id => 0
+    object_id => -4
   );
 
   insert into acs_magic_objects
    (name, object_id)
   values
-   ('security_context_root', 0);
+   ('security_context_root', -4);
 end;
 /
 show errors
@@ -229,33 +229,56 @@
 /
 show errors
 
+declare
+  foo acs_objects.object_id%TYPE;
 begin
- insert into acs_objects
-  (object_id, object_type)
- values
-  (-1, 'party');
 
- insert into parties
-  (party_id)
- values
-  (-1);
+  -- Make the "Unregistered Visitor" be object 0, which corresponds
+  -- with the user_id assigned throughout the toolkit Tcl code
 
- insert into acs_magic_objects
-  (name, object_id)
- values
-  ('the_public', -1);
+  insert into acs_objects
+    (object_id, object_type)
+  values
+    (0, 'person');
 
- commit;
-end;
-/
-show errors
+  insert into parties
+    (party_id)
+  values
+    (0);
 
--- Insert the site-wide group. The members of this
--- group correspond to all registered users.
-declare
-  group_id integer;
-begin
-  group_id := acs_group.new (
+  insert into persons
+    (person_id, first_names, last_name)
+  values
+    (0, 'Unregistered', 'Visitor');
+
+  insert into acs_magic_objects
+    (name, object_id)
+  values
+    ('unregistered_visitor', 0);
+
+  -- Create the public group
+  foo := acs_group.new (
+    group_id => -1,
+    group_name => 'The Public'
+  );
+
+  insert into acs_magic_objects
+   (name, object_id)
+  values
+   ('the_public', -1);
+
+  -- Add our only user, the Unregistered Visitor, to the public group
+
+  foo := membership_rel.new (
+           rel_type => 'membership_rel',
+           object_id_one => acs.magic_object_id('the_public'),      
+           object_id_two => acs.magic_object_id('unregistered_visitor'),
+           member_state => 'approved'
+         );
+
+  -- Make the registered users group
+
+  foo := acs_group.new (
     group_id => -2,
     group_name => 'Registered Users'
   );
@@ -265,10 +288,19 @@
  values
   ('registered_users', -2);
 
- commit;
+  -- Now declare "The Public" to be composed of itself and the "Registered
+  -- Users" group
+
+  foo := composition_rel.new (
+           rel_type => 'composition_rel',
+           object_id_one => acs.magic_object_id('the_public'),
+           object_id_two => acs.magic_object_id('registered_users')
+         );
+
+  commit;
 end;
 /
-show errors
+show errors;
 
 -- Create the default context.
 declare
@@ -286,4 +318,5 @@
   commit;
 end;
 /
-show errors
+show errors;
+
