Currently, delete tag is constrained by an FK to roaddetails, so that a user
cannot delete tags that are attached to roads. This results in an exception and
the tag is not deleted. The same is true for deleting a tag associated with a
traffic count (we don't want the users traffic counts to disappear if they
accidentally delete a tag).
However, we DO want to delete associated default traffic flow and traffic flow
report records associated with the tagid. This would be easy if we had an ON
DELETE CASCADE check in tagdetails, but would delete roads and everything else
associated with the tagid.
The fix is to do an explicit delete in TagBO. If a delete of a tag passes the
roaddetails and trafficount constraints, then assume that we can delete the
associated trafficflowreport and defaulttrafficflow records.
This would prevent a large amount of orphaned rows, especially in the traffic
flow report table.
Original issue reported on code.google.com by stuartmo...@gmail.com on 22 Aug 2010 at 12:59
Original issue reported on code.google.com by
stuartmo...@gmail.com
on 22 Aug 2010 at 12:59