Forum OpenACS Development: Calendar pkg: call_item and acs_activity
Are they supposed to stay in the datamodel?
Since I've found no references in /api-doc to remove acs_activities, I've written the code to manually remove them, but I'm not sure if it's complete. Perhaps, I could have missed anything.
::xo::db::sql::acs_activity delete -activity_id XXXX
the technical reason why activities don't get removed automatically at the removal of a cal_item is this: cal_items.cal_item_id references acs_events.event_id, but no ON DELETE behavior is defined. On the other hand, acs_events.event_id references acs_activities.activity_id and there we have ON DELETE SET NULL defined. Therefore, is not clear to me whether automatic deletion of related activity and event tuples is fine in general for all packages that reuse acs-events.
I will try to have a deeper look, in the meantime whoever might have better insight could give some comments.
actually, if one looks at calendar::item::delete -cal_item_id https://openacs.org/api-doc/proc-view?proc=calendar::item::delete&source_p=1, this should call ca_item__delete stored procedure https://openacs.org/api-doc/plsql-subprogram-one?name=cal_item__delete&type=FUNCTION, which should in fact remove the acs_event.
Are you making use of this API? Or you're deleting via some custom code?
I've used cal_item__delete and I haven't touched into the core's ad_procs.
Pkg versions are:
provides url="calendar" version="2.6.1d3"/
provides url="acs-events" version="0.6.1.1"
provides url="acs-kernel" version="5.9.1"/
I've noticed the dependencies (relationships) among calendar, acs-events and so, while I was debugging the "code workflow".
Thanks for the lesson! I understand why acs-events supports calendar pkg. It makes total sense.