Skip to content

deleteRules.csv for deciding deleting or zapping

Nikhil VJ edited this page Sep 4, 2018 · 1 revision

From v2.0.0 onwards a deleteRules CSV file has been created in /config folder which holds the information about deleting or zapping, pertaining to whether that field is mandatory or optional for that table.

Explanation with two kinds of ID's as example:

key action table column_name
stop_id delete stops
stop_id delete stop_times
stop_id delete transfers from_stop_id
stop_id delete transfers to_stop_id
agency_id delete agency
agency_id zap routes
agency_id zap fare_attributes

stop_id : Suppose we have to delete stop_id="STP1":

  • in tables stops and stop_times, delete all rows where stop_id="STP1"
  • in table transfers, delete all rows where from_stop_id="STP1"
  • again in table transfers, delete all rows where to_stop_id="STP1"

agency_id : Suppose we have to delete agency_id="AGC1":

  • in table agency, delete all rows (only one) where agency_id="AGC1"
  • in tables routes and fare_attributes, we don't have to delete any rows, but wherever agency_id="AGC1", those cells have to be set as blank, agency_id=""

The user can edit this file and thus configure how the program decides things without having to change anything in the code. If any tables or columns are missing from the data at hand, the program silently skips those rows.