Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Normalization of negative stop_seq can cause unique constraint failure #26

Open
laurentg opened this issue Feb 8, 2016 · 0 comments
Open
Labels

Comments

@laurentg
Copy link
Contributor

laurentg commented Feb 8, 2016

The stop_seq field is part of the primary key of table stop_times. As we remap stop_seq in an increasing order, remapping negative values can lead to unique constraint failure as we move indexes to larger values (for example -1 is remapped to 0 before 0 is remapped to 1).

To solve this, we need to analyze the graph of remapping and start with the non-conflicting indexes first, as processing in a decreasing order for negative values can also fail if we have non-consecutive indexes: for example the following sequence: { -2, -1, 0, 4, 6 } => { 0, 1, 2, 3, 4 } (Here the first remap 6 to 4 will fail).

@laurentg laurentg added the bug label Feb 8, 2016
@laurentg laurentg changed the title Normalization of negative stop_sequence cause unique constraint failure Normalization of negative stop_sequence can cause unique constraint failure Feb 8, 2016
@laurentg laurentg changed the title Normalization of negative stop_sequence can cause unique constraint failure Normalization of negative stop_seq can cause unique constraint failure Feb 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant