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.5 -r1.6 --- openacs-4/packages/acs-content-repository/sql/oracle/content-create.sql 8 Oct 2001 23:33:01 -0000 1.5 +++ openacs-4/packages/acs-content-repository/sql/oracle/content-create.sql 9 Oct 2001 04:31:24 -0000 1.6 @@ -222,6 +222,15 @@ storage_area_key varchar2(100) ); +comment on table cr_files_to_delete is ' + Table to store files to be deleted by a scheduled sweep. + Since binaries are stored in filesystem and attributes in database, + need a way to delete both atomically. So any process to delete file-system cr_revisions, + copies the file path to this table as part of the delete transaction. Sweep + run later to remove the files from filesystem once database info is successfully deleted. +'; + + create table cr_child_rels ( rel_id integer constraint cr_child_rels_rel_pk Index: openacs-4/packages/acs-content-repository/sql/oracle/content-image-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/oracle/content-image-drop.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-content-repository/sql/oracle/content-image-drop.sql 24 Mar 2001 22:00:48 -0000 1.1 +++ openacs-4/packages/acs-content-repository/sql/oracle/content-image-drop.sql 9 Oct 2001 04:31:24 -0000 1.2 @@ -45,4 +45,4 @@ show errors - +drop package image; Index: openacs-4/packages/acs-content-repository/sql/oracle/content-image.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/oracle/content-image.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-content-repository/sql/oracle/content-image.sql 27 Sep 2001 22:48:16 -0000 1.2 +++ openacs-4/packages/acs-content-repository/sql/oracle/content-image.sql 9 Oct 2001 04:31:24 -0000 1.3 @@ -122,10 +122,10 @@ relation_tag in cr_child_rels.relation_tag%TYPE default null, is_live in char default 'f', publish_date in cr_revisions.publish_date%TYPE default sysdate, - path in images.path%TYPE, + path in varchar, height in images.height%TYPE default null, width in images.width%TYPE default null, - file_size in images.file_size%TYPE default null + file_size in cr_revisions.content_length%TYPE default null ) return cr_items.item_id%TYPE; --/** @@ -171,10 +171,10 @@ relation_tag in cr_child_rels.relation_tag%TYPE default null, is_live in char default 'f', publish_date in cr_revisions.publish_date%TYPE default sysdate, - path in images.path%TYPE, + path in varchar, height in images.height%TYPE default null, width in images.width%TYPE default null, - file_size in images.file_size%TYPE default null + file_size in cr_revisions.content_length%TYPE default null ) return cr_items.item_id%TYPE is v_item_id cr_items.item_id%TYPE; @@ -203,6 +203,7 @@ publish_date => publish_date, mime_type => mime_type, nls_language => nls_language, + text => path, creation_date => sysdate, creation_user => creation_user, creation_ip => creation_ip @@ -215,8 +216,7 @@ -- update revision with image file info update cr_revisions - set content_length = file_size, - content = path + set content_length = file_size where revision_id = v_revision_id; -- is_live => 't' not used as part of content_item.new @@ -236,10 +236,8 @@ revision_id in cr_revisions.revision_id%TYPE ) is + v_content cr_files_to_delete.path%TYPE default null; begin - insert into cr_files_to_delete (path) - select path from images where image_id = image.delete_revision.revision_id; - content_revision.delete ( revision_id => revision_id );