Ticket #38 (closed review: fixed)

Opened 2 years ago

Last modified 20 months ago

Cascading delete needs to be slightly smarter

Reported by: pobrien Owned by: mscott
Priority: normal Milestone: Schevo 3.1a1
Component: All Components Keywords:
Cc:

Description (last modified by mscott) (diff)

The cascading delete system needs to be improved to support a number of things:

  • Edge cases where a cascading delete is blocked by a reference from some entity that is already known to be deleted during the same transaction.
  • Support for EntityList?, EntitySet?, and custom entity-storing fields.
  • New REMOVE option for on_delete specs, which implies that if entity A has an EntityList? field that contains entity B, and entity B is deleted, entity B should be removed from the list on entity A.

Also covered in this ticket is allowing direct mutation of EntityList? and EntitySet? field values in a transaction, while making them immutable when attached to entities and views.

ALSO covered are allow_unassigned and allow_duplicates for EntityList?, and allow_empty for EntityList? and EntitySet?.

Change History

Changed 21 months ago by mscott

  • milestone set to Schevo 3.1a1

One failing test case that is still commented out as of this writing can be found at: source:tags/releases/Schevo-3.0/tests/test_on_delete.py#L198

This ticket could be rewritten to describe the smarter cascade delete system that we envision -- the one that supports RESTRICT/CASCADE/UNASSIGN/REMOVE options and also supports EntityList? fields and the like.

Changed 20 months ago by mscott

  • owner set to mscott
  • status changed from new to assigned
  • type changed from discussion to implementation
  • description modified (diff)

Changed 20 months ago by mscott

r3211 fixes edge cases where cascade delete didn't work right because of a sneaky RESTRICT. All cascade delete tests are uncommented, and all pass.

Changed 20 months ago by mscott

  • description modified (diff)

Changed 20 months ago by mscott

Implementation and docs complete as of r3218.

We'll need to figure out how to handle UNASSIGN with EntityList? and EntitySet? before we do a final review and merge.

Changed 20 months ago by mscott

  • description modified (diff)

Changed 20 months ago by mscott

  • type changed from implementation to review

Ready for review at r3224

Changed 20 months ago by mscott

r3230 changes behavior to ignore allow_empty and instead enforce min_size and max_size constraints.

Changed 20 months ago by mscott

pobrien added an EntitySetSet? field type.

This branch has been mutually reviewed and is scheduled for merge to trunk on 2007-05-24.

Changed 20 months ago by mscott

  • status changed from assigned to closed
  • resolution set to fixed

merged at r3233

Note: See TracTickets for help on using tickets.