udotdevelopment / ATSPM

Automated Traffic Signal Performance Measures (ATSPM) are a series of visual aids that display the high-resolution data from signal controllers. They are a valuable asset management tool, aiding personnel in the control of both signal hardware and signal timing and coordination. They allow analysis of data collected 24 hours a day, 7 days a week, improving the accuracy, flexibility, and performance of signal equipment and the system as a whole. ATSPM are used to optimize mobility, manage traffic signal timing and maintenance, reduce congestion, save fuel costs and improve safety.
Apache License 2.0
76 stars 41 forks source link

Foreign Key Constraints with Aggregations prevent deleting Phase/Detection groups #87

Open ian-cameron opened 4 years ago

ian-cameron commented 4 years ago

Also known as Approaches in the code, they are called Phase/Detection groups on the Signal Configuration page. You cannot delete them if they have been used in the approach aggregation charts, and get Internal Server Error 500. The error is a database FK_Constraint on ApproachCycleAggregations, ApproachPcdAggregations, and ApproachSplitFailAggregations tables (Foreign Key: ApproachID).

The manual fix is to delete all the rows from the aggregation tables that contain the approach ID you are trying to delete.

This only matters if you are running aggregations in the first place. We wanted to document it here, but are unsure of the best fix- either database or code.

udotdevelopment commented 3 years ago

We are currently doing more in depth testing on the aggregations so we will look into this.