Currently, service area values are calculated in make_service_area_summary and stored in the service_area_summary table, where each column corresponds to a service area. Since service areas can be added ro removed in config.py, the table is generated dynamically on each run and does not have a fixed schema in models.py. This eases the configuration process but has created problems with migrations and initializing new engine databases. It may be helpful to deprecate the service_area_summary in favor of a service_area_tag table with a key-value structure like;
| id | street_address | service_area_id | value |
=================================================================
| 1 | 12 OAK LN | census_block | 1 |
| 2 | 12 OAK LN | rubbish_day | Thurs |
@mjumbewu do you think this could be workable in terms of API performance? With the right indexes?
Note: this wouldn't affect/deprecate the service_area_summary table in GeoDB2, so we'd still need a script to export service area tags in the existing format.
Currently, service area values are calculated in
make_service_area_summary
and stored in theservice_area_summary
table, where each column corresponds to a service area. Since service areas can be added ro removed inconfig.py
, the table is generated dynamically on each run and does not have a fixed schema inmodels.py
. This eases the configuration process but has created problems with migrations and initializing new engine databases. It may be helpful to deprecate theservice_area_summary
in favor of aservice_area_tag
table with a key-value structure like;@mjumbewu do you think this could be workable in terms of API performance? With the right indexes?