conveyal / gtfs-lib

A library for loading and saving GTFS feeds of arbitrary size with disk-backed storage
BSD 2-Clause "Simplified" License
71 stars 38 forks source link

Cascade delete on route and pattern delete #350

Closed br648 closed 2 years ago

br648 commented 2 years ago

Checklist

Description

To address these Jira tickets:

  1. https://ibisolutions.atlassian.net/browse/DT-71
  2. https://ibisolutions.atlassian.net/browse/DT-72

A refactor to delete pattern stops, stop times, frequencies and shapes when a route or pattern is deleted. DT only has one level deep deletes, so prior to this update only patterns and trips were deleted leaving orphaned pattern stops, stop times, frequencies and shapes (second level references).

To test locally run the following maven command on GTFS-Lib: mvn install -Dmaven.test.skip=true and then update the datatools-server dependency to:

        <dependency>
            <groupId>com.conveyal</groupId>
            <artifactId>gtfs-lib</artifactId>
            <version>7.0.2</version>
            <!-- Exclusions added in order to silence SLF4J warnings about multiple bindings:
                http://www.slf4j.org/codes.html#multiple_bindings
            -->
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-simple</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

NOTE!

It looks like this will require an update to the UI as well in the form of a refresh. With an update in place to delete shapes if a route or pattern is deleted the route alignments remain until the map is refreshed. E.g. Click on “Back to Feed” and then “Edit feed” will show the updated route alignments.

br648 commented 2 years ago

@binh-dam-ibigroup feedback addressed, thanks. I've also refactored which has cleaned this up a bit.

br648 commented 2 years ago

@philip-cline Updated to test deleting frequencies.