From 327d6686fb425f81df7878cee3cb812be76eed74 Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Fri, 6 Jun 2025 11:55:22 +0200 Subject: [PATCH] fixed import to create new strasse if needed --- .../leibnitz/01-addressdb_update_buildings.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/addressdb/leibnitz/01-addressdb_update_buildings.php b/scripts/addressdb/leibnitz/01-addressdb_update_buildings.php index 332190cb1..c920dbfba 100644 --- a/scripts/addressdb/leibnitz/01-addressdb_update_buildings.php +++ b/scripts/addressdb/leibnitz/01-addressdb_update_buildings.php @@ -228,8 +228,15 @@ while($csv = fgetcsv($input, 0, ",")) { } if(!$strasse) { - echo "Strasse not found for variations of: $strasse_name (gemeinde_id $gemeinde_id)\n"; - continue; + echo "Strasse not found for variations of: $strasse_name (gemeinde_id $gemeinde_id), creating new one.\n"; + $strasse_data = [ + "gemeinde_id" => $gemeinde_id, + "name" => $strasse_name, + "create" => date("U"), + "edit" => date("U"), + ]; + $strasse = ADBStrasseModel::create($strasse_data); + $strasse->save(); } $plz = ADBPlzModel::getFirst(["gemeinde_id" => $gemeinde_id, "plz" => $plz_name]);