lijian8 / tamt

Automatically exported from code.google.com/p/tamt
0 stars 0 forks source link

Delete tag should delete associated vehicle flow entities #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
Issue 28 has been merged into this issue.

Original comment by stuartmo...@gmail.com on 18 Jun 2011 at 1:26