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

Normalization of negative stop_seq can cause unique constraint failure #26

@laurentg

Description

@laurentg

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions