Hank Beatty commented on TC-100:

[~mitchell...@apache.org] Is this still an issue? If so, are we planning on 
fixing in 2.1?

> DELETE api/version/regions/:id should ensure no phys locs are in the region
> ---------------------------------------------------------------------------
>                 Key: TC-100
>                 URL: https://issues.apache.org/jira/browse/TC-100
>             Project: Traffic Control
>          Issue Type: Bug
>          Components: Traffic Ops API
>            Reporter: Jeremy Mitchell
>            Priority: Minor
>              Labels: api_regions
> Currently, you can attempt to delete a region that is employed by a phys 
> location which results in a database FK constraint error.
> DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::Pg::st execute 
> failed: ERROR:  update or delete on table "region" violates foreign 
> key constraint "fk_phys_location_region" on table 
> "phys_location"
> DETAIL:  Key (id)=(1) is still referenced from table 
> "phys_location". [for Statement "DELETE FROM region WHERE ( id 
> = ? )" with ParamValues: 1='1'] at 
> /opt/traffic_ops/app/lib/API/Region.pm line 243
> the api needs to ensure that no phys locs use the region before attempting to 
> delete the region.

This message was sent by Atlassian JIRA

Reply via email to