UC Delete Bike Train


This came about when making copies of bike trains from previous quarters and generating various test routes, that I needed to get rid of some Bike Trains. The manual procedure takes a little while because of the table dependencies, so it makes sense to automate this.

In one case, we'll want to delete a single route, but often there are multiple routes that we could delete at once. Having the check-box serve as an indicator of what we want to delete would be useful for the latter.

Basic Course of Events

Map Maker

''Some interesting questions about whether to filter based on current quarter or not.''

  1. Map Maker requests list of current quarter's bike trains.
  2. App provides the list with an opportunity to select one or more to be deleted.
  3. Map Maker requests that the list be deleted.
  4. App makes the copy and presents the bike trains for the current quarter in a list and shows the current map.

Alternate Course

Map Maker

  1. Click on a particular route to request that it be deleted (perhaps an icon?)

Manual Procedure

These are the manual steps performed in the database. Generally, we'll know the quarter we want to delete from and the DisplayElement/BikeTrain we want to delete.


  1. The CurrentTrains view will show the ELEMENT_ID and the GROUP_ID of the records you'd like to delete from the current quarter. Other quarters will require a little more work to find the desired ELEMENT_ID.
  2. Use phpMyAdmin DB Browser to browse to the MAP_ELEMENT_GROUP table of the 'routes' database (I like to sort by Primary key descending so most recent are at the top). This will show the most recent records and probably the ones you'd like to delete.
  3. Remove the record matching the ELEMENT_ID. Remember the ELEMENT_ID if you'd also like to remove the DisplayElement record. (Generally you will).
  4. If you want to remove the DisplayElement, Go to the DisplayElement table and sort descending by ELEMENT_ID. This should display the record you're interested in if it was recently added.
  5. Remove that record. The BikeTrain record can usually stay and won't be in the way.

You can now refresh the showRoutes and view the new Bike Train.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License