Index: openacs-4/packages/acs-content-repository/sql/oracle/content-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/oracle/content-create.sql,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/acs-content-repository/sql/oracle/content-create.sql	14 Oct 2001 21:02:27 -0000	1.7
+++ openacs-4/packages/acs-content-repository/sql/oracle/content-create.sql	16 Oct 2001 01:36:19 -0000	1.8
@@ -365,26 +365,6 @@
   4000 character limit.
 ';
 
-
--- (DanW - OpenACS) Added cleanup trigger to log file items that need 
--- to be cleaned up from the CR.
-
-create or replace trigger cr_cleanup_cr_files_del_trg
-before delete on cr_revisions
-for each row
-begin
-        insert into cr_files_to_delete (
-          path, storage_area_key
-        ) select blob_to_string(r.content), i.storage_area_key
-            from cr_items i, cr_revisions r
-           where i.item_id = r.item_id
-             and r.revision_id = :old.revision_id
-             and i.storage_type = 'file';
-
-end cr_cleanup_cr_files_del_trg;
-/
-show errors
-
 --------------------------------------------------------------
 -- CONTENT PUBLISHING
 --------------------------------------------------------------
@@ -761,8 +741,29 @@
   into HTML (or plain text) prior to insertion into the repository.
 ';
 
+-- (DanW - OpenACS) Added cleanup trigger to log file items that need 
+-- to be cleaned up from the CR.
 
+-- DRB: moved here because the package "content" needs to be defined
+-- before this trigger is created.
 
+create or replace trigger cr_cleanup_cr_files_del_trg
+before delete on cr_revisions
+for each row
+begin
+        insert into cr_files_to_delete (
+          path, storage_area_key
+        ) select content.blob_to_string(r.content), i.storage_area_key
+            from cr_items i, cr_revisions r
+           where i.item_id = r.item_id
+             and r.revision_id = :old.revision_id
+             and i.storage_type = 'file';
+
+end cr_cleanup_cr_files_del_trg;
+/
+show errors
+
+
 prompt *** Compiling documentation package...
 @@ doc-package
 
@@ -842,5 +843,3 @@
 end;
 /
 show errors
-
-
