You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(exports): wire postcodes table into all export formats (#1039) (#1403)
Completes the deferred export-pipeline work from #1398. With the
postcodes table now landed, every export command and the workflow
itself learns to emit postcode data alongside the existing 5 tables.
PHP commands (Symfony Console)
- ExportJson: SELECT from postcodes (graceful skip if table missing),
emit /json/postcodes.json
- ExportCsv: add 'postcodes' to FILES; guard empty arrays so empty
source files no longer crash on $csc[0] access
- ExportXml / ExportYaml: add 'postcodes' to FILES; replace fragile
?: throw on empty arrays with explicit is_array() check
- ExportSqlServer: add 'postcodes' to TABLES with full CREATE TABLE
schema (FKs to countries/states/cities, nullable state/city)
- ExportMongoDB: add 'postcodes' to COLLECTIONS plus processPostcodes()
with country/state DBRef references and GeoJSON Point location
Python helpers
- export_plist.py: include postcodes.csv with missing-file guard so
the script no-ops cleanly until first country PR lands
- sync_mysql_to_json.py: new sync_postcodes() per-country file writer
mirroring sync_cities; export_schema includes postcodes when present
Workflow
- postcode_count env var (graceful 0 if table absent)
- mysqldump postcodes -> sql/postcodes.sql
- pg_dump postcodes -> psql/postcodes.sql
- mysql2sqlite postcodes -> sqlite/postcodes.sqlite3
- mongoimport gated on non-empty postcodes.json
- gzip postcodes.sql in sql/ and psql/ when present
- POSTCODE_COUNT exposed to Release body and PR body
Behaviour with empty postcodes table
- Importer/JSON/CSV/XML/YAML produce empty postcodes.json (or skip in
CSV's case) without erroring
- mongoimport skipped via jq length check
- mysqldump still emits the (empty) DDL, so consumers can rely on the
table existing in every export format
Refs: #1039
Builds on: #1398
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments