You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by "Hank Beatty (JIRA)" <ji...@apache.org> on 2017/08/10 13:46:00 UTC

[jira] [Commented] (TC-100) DELETE api/version/regions/:id should ensure no phys locs are in the region

    [ https://issues.apache.org/jira/browse/TC-100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16121625#comment-16121625 ] 

Hank Beatty commented on TC-100:
--------------------------------

[~mitchell852@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 &quot;region&quot; violates foreign key constraint &quot;fk_phys_location_region&quot; on table &quot;phys_location&quot;
> DETAIL:  Key (id)=(1) is still referenced from table &quot;phys_location&quot;. [for Statement &quot;DELETE FROM region WHERE ( id = ? )&quot; with ParamValues: 1=&#39;1&#39;] 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
(v6.4.14#64029)