Index: openacs-4/contrib/packages/general-comments/sql/postgresql/general-comments-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/sql/postgresql/Attic/general-comments-create.sql,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/packages/general-comments/sql/postgresql/general-comments-create.sql	2 May 2003 15:49:31 -0000	1.1
+++ openacs-4/contrib/packages/general-comments/sql/postgresql/general-comments-create.sql	5 May 2003 01:14:18 -0000	1.2
@@ -13,23 +13,19 @@
 -- create a table to extend cr_items
 create table general_comments (
     comment_id  integer  constraint general_comments_comment_id_fk
-                references acs_messages (message_id) on delete cascade 
+                references cr_revision (revision_id) on delete cascade 
                 constraint general_comments_pk
                 primary key,
     object_id   integer constraint general_comments_object_id_fk
 	        references acs_objects (object_id) on delete cascade,
-    category    varchar(1000)
 );
 comment on table general_comments is '
-    Extends the acs_messages table to hold item level data.
+    Extends the cr_revisions table to hold item level data.
 '; 
 comment on column general_comments.object_id is '
     The id of the object to associate message with
 ';
-comment on column general_comments.category is '
-    This feature is not complete. The purpose is to allow separation of 
-    comments into categories.  
-';
+-- unused catergory feature removed. Should be new categories package. DaveB
 
 -- create an index on foreign key constraint
 create index general_comments_object_id_idx on general_comments (object_id);
@@ -53,11 +49,14 @@
     PERFORM acs_privilege__add_child(''create'',''general_comments_create'');
     
     -- allow registered users to create comments
-    PERFORM acs_permission__grant_permission (
-        default_context,
-        registered_users,
-        ''general_comments_create''
-    );
+-- This is questionable. If we allow seperate gc instances per subsite this
+-- will not work. DaveB
+
+--    PERFORM acs_permission__grant_permission (
+--        default_context,
+--        registered_users,
+--        ''general_comments_create''
+--    );
     
     return 0;
 end;' language 'plpgsql';
@@ -68,34 +67,50 @@
 
 -- show errors
 
+
+-- Do we need this or anything like it? DaveB
+
 -- NOTE: this is only temporary until we figure out how
 --       packages will register child types to an acs-message
-create function inline_1 ()
-returns integer as '
-begin
+-- create function inline_1 ()
+-- returns integer as '
+-- begin
 
-    PERFORM content_type__register_child_type (
-        /* parent_type => */ ''acs_message_revision'',
-        /* child_type  => */ ''content_revision'',
-	''generic'', 0, null
-    );
-    PERFORM content_type__register_child_type (
-        /* parent_type => */ ''acs_message_revision'',
-        /* child_type  => */ ''image'',
-	''generic'', 0, null
-    );
-    PERFORM content_type__register_child_type (
-        /* parent_type => */ ''acs_message_revision'',
-        /* child_type  => */ ''content_extlink'',
-	''generic'', 0, null
-    );
-    return 0;
-end;' language 'plpgsql';
+--     PERFORM content_type__register_child_type (
+--         /* parent_type => */ ''acs_message_revision'',
+--         /* child_type  => */ ''content_revision'',
+-- 	''generic'', 0, null
+--     );
+--     PERFORM content_type__register_child_type (
+--         /* parent_type => */ ''acs_message_revision'',
+--         /* child_type  => */ ''image'',
+-- 	''generic'', 0, null
+--     );
+--     PERFORM content_type__register_child_type (
+--         /* parent_type => */ ''acs_message_revision'',
+--         /* child_type  => */ ''content_extlink'',
+-- 	''generic'', 0, null
+--     );
+--     return 0;
+-- end;' language 'plpgsql';
 
-select inline_1 ();
+-- select inline_1 ();
 
-drop function inline_1 ();
+-- drop function inline_1 ();
 
--- show errors
+-- create general comment type as subtype or cr_revision
 
+select content_type__create_type (
+        'general_comment',        -- content_type
+	'content_revision',         -- supertype
+	'General Comment',       -- pretty_name
+	'General Comments',      -- pretty_plural
+	'general_comments',            -- table_name
+	'comment_id',              -- id_column
+	'content_revision__revision_name'  -- name_method
+);
 
+
+-- source plpgsql functions
+
+\i general-comments-plsql-create.sql
\ No newline at end of file
