Index: openacs-4/packages/file-storage/sql/oracle/file-storage-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/oracle/file-storage-create.sql,v diff -u -r1.10 -r1.10.2.1 --- openacs-4/packages/file-storage/sql/oracle/file-storage-create.sql 4 Mar 2002 18:26:03 -0000 1.10 +++ openacs-4/packages/file-storage/sql/oracle/file-storage-create.sql 17 Mar 2002 04:22:29 -0000 1.10.2.1 @@ -203,23 +203,17 @@ ) return fs_root_folders.folder_id%TYPE is v_folder_id fs_root_folders.folder_id%TYPE; - v_count integer; begin - select count(*) - into v_count + + -- JS: We do not have to check (and create if none) for a root folder anymore + -- since APM will do the root folder creation for us, using the + -- "post_instantiation" feature. + + select folder_id + into v_folder_id from fs_root_folders where package_id = get_root_folder.package_id; - if v_count > 0 then - select folder_id - into v_folder_id - from fs_root_folders - where package_id = get_root_folder.package_id; - else - -- must be a new instance. Gotta create a new root folder - v_folder_id := new_root_folder(package_id); - end if; - return v_folder_id; end get_root_folder; Index: openacs-4/packages/file-storage/sql/postgresql/file-storage-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/postgresql/file-storage-create.sql,v diff -u -r1.12.2.2 -r1.12.2.3 --- openacs-4/packages/file-storage/sql/postgresql/file-storage-create.sql 13 Mar 2002 19:01:52 -0000 1.12.2.2 +++ openacs-4/packages/file-storage/sql/postgresql/file-storage-create.sql 17 Mar 2002 04:22:14 -0000 1.12.2.3 @@ -68,21 +68,15 @@ declare get_root_folder__package_id alias for $1; v_folder_id fs_root_folders.folder_id%TYPE; - v_count integer; begin - select count(*) into v_count - from fs_root_folders - where package_id = get_root_folder__package_id; + -- JS: We do not have to check (and create if none) for a root folder anymore + -- since APM will do the root folder creation for us, using the + -- "post_instantiation" feature. - if v_count > 0 then - select folder_id into v_folder_id - from fs_root_folders - where package_id = get_root_folder__package_id; - else - -- must be a new instance. Gotta create a new root folder - v_folder_id := file_storage__new_root_folder(get_root_folder__package_id, null, null); - end if; + select folder_id into v_folder_id + from fs_root_folders + where package_id = get_root_folder__package_id; return v_folder_id;