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
''Some interesting questions about whether to filter based on current quarter or not.''
- Map Maker requests list of current quarter's bike trains.
- App provides the list with an opportunity to select one or more to be deleted.
- Map Maker requests that the list be deleted.
- App makes the copy and presents the bike trains for the current quarter in a list and shows the current map.
- Click on a particular route to request that it be deleted (perhaps an icon?)
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.
- 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.
- 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.
- Remove the record matching the ELEMENT_ID. Remember the ELEMENT_ID if you'd also like to remove the DisplayElement record. (Generally you will).
- 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.
- 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.