Forum OpenACS Q&A: Error deleting a folder in file-storage

Removing a default folder like "Assignments" in file-storage in dotlrn does this call:

select file_storage__delete_folder('65413','t');

But an error is thrown: snom_object_id_fk in acs_objects. site_node_object_mappings is still referencing that object.

Looking in acs_objects for that node_id turns out that it is site node of the file-storage.

Collapse
Posted by Nima Mazloumi on
CONSTRAINT snom_object_id_fk FOREIGN KEY (object_id)
REFERENCES acs_objects (object_id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION

Why not:

ON UPDATE CASCADE ON DELETE CASCADE

Collapse
Posted by Nima Mazloumi on
ALTER TABLE site_node_object_mappings DROP CONSTRAINT snom_object_id_fk;

ALTER TABLE site_node_object_mappings ADD CONSTRAINT snom_object_id_fk FOREIGN KEY (object_id) REFERENCES acs_objects (object_id) ON UPDATE CASCADE ON DELETE CASCADE;

Collapse
Posted by Dave Bauer on
Weird, I thought I fixed that a long time ago.

That is a dotlrn specific thing, I don't really know what the purpose is of it.

Collapse
Posted by Don Baccus on
Please write up an upgrade script if you have time, and test it, Nima.

And edit the initial install SQL script, too, if you do! :)

The same ALTER TABLEs should work on oracle EXCEPT that Oracle does not support ON UPDATE CASCADE, only ON DELETE CASCADE.

If you can edit initial install and upgrade scripts for Oracle, too, and afterwards e-mail honchos I'm sure you can get daveb to test it ...

or me ...