Index: openacs-4/contrib/packages/general-comments/sql/oracle/general-comments-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/sql/oracle/Attic/general-comments-create.sql,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/packages/general-comments/sql/oracle/general-comments-create.sql	2 May 2003 15:49:13 -0000	1.1
+++ openacs-4/contrib/packages/general-comments/sql/oracle/general-comments-create.sql	19 Jun 2003 18:04:03 -0000	1.2
@@ -11,24 +11,24 @@
 
 -- create a table to extend cr_items
 create table general_comments (
-    comment_id  constraint general_comments_comment_id_fk
-                references acs_messages (message_id) on delete cascade 
+    comment_id  integer  constraint general_comments_comment_id_fk
+                references cr_revision (revision_id) on delete cascade 
                 constraint general_comments_pk
                 primary key,
-    object_id   constraint general_comments_object_id_fk
+    object_id   integer constraint general_comments_object_id_fk
 	        references acs_objects (object_id) on delete cascade,
-    category    varchar2(1000)
+    package_id  integer constraing general_comments_package_id_fk
+		references apm_packages (package_id) on delete cascade
 );
+
+
 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);
@@ -48,13 +48,16 @@
 
     -- associte privileges to global privileges
     acs_privilege.add_child('create','general_comments_create');
-    
+  
+-- This is questionable. If we allow seperate gc instances per subsite this
+-- will not work. DaveB
+  
     -- allow registered users to create comments
-    acs_permission.grant_permission (
-       object_id  => default_context,
-       grantee_id => registered_users,
-       privilege  => 'general_comments_create'
-    );
+--    acs_permission.grant_permission (
+--       object_id  => default_context,
+--       grantee_id => registered_users,
+--       privilege  => 'general_comments_create'
+--    );
 
 end;
 /
@@ -82,3 +85,19 @@
 show errors
 
 
+-- create general comment type as subtype of cr_revision
+begin
+
+select content_type.create_type (
+        content_type => 'general_comment',
+	supertype => 'content_revision',
+	pretty_name => 'General Comment',
+	pretty_plural => 'General Comments',
+	table_name => 'general_comments',
+	id_column => 'comment_id',
+	name_method => 'content_revision.revision_name'
+);
+
+end;
+/
+show errors
