-
Notifications
You must be signed in to change notification settings - Fork 46
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
andstop_times
, delete all rows wherestop_id="STP1"
- in table
transfers
, delete all rows wherefrom_stop_id="STP1"
- again in table
transfers
, delete all rows whereto_stop_id="STP1"
agency_id : Suppose we have to delete agency_id="AGC1"
:
- in table
agency
, delete all rows (only one) whereagency_id="AGC1"
- in tables
routes
andfare_attributes
, we don't have to delete any rows, but whereveragency_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.