Update aerodrome_label class in DIFF_MODE=true (#1371)

The class field was not updated if needed during the import of changes in DIFF_MODE=true.
pull/1375/head^2
zstadler 2022-04-20 06:50:37 +03:00 zatwierdzone przez GitHub
rodzic 22915df783
commit 2d0b7159d0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 11 dodań i 6 usunięć

Wyświetl plik

@ -8,12 +8,6 @@ CREATE INDEX IF NOT EXISTS osm_aerodrome_label_point_type_partial_idx
WHERE aerodrome_type = 'international' WHERE aerodrome_type = 'international'
AND iata <> ''; AND iata <> '';
UPDATE osm_aerodrome_label_point SET aerodrome_type=(
CASE
%%FIELD_MAPPING: class %%
ELSE 'other' END
);
CREATE SCHEMA IF NOT EXISTS aerodrome_label; CREATE SCHEMA IF NOT EXISTS aerodrome_label;
CREATE TABLE IF NOT EXISTS aerodrome_label.osm_ids CREATE TABLE IF NOT EXISTS aerodrome_label.osm_ids
@ -34,6 +28,17 @@ $$
WHERE (full_update OR osm_id IN (SELECT osm_id FROM aerodrome_label.osm_ids)) WHERE (full_update OR osm_id IN (SELECT osm_id FROM aerodrome_label.osm_ids))
AND COALESCE(tags->'name:latin', tags->'name:nonlatin', tags->'name_int') IS NULL AND COALESCE(tags->'name:latin', tags->'name:nonlatin', tags->'name_int') IS NULL
AND tags != update_tags(tags, geometry); AND tags != update_tags(tags, geometry);
UPDATE osm_aerodrome_label_point
SET aerodrome_type=
CASE
%%FIELD_MAPPING: class %%
ELSE 'other' END
WHERE (full_update OR osm_id IN (SELECT osm_id FROM aerodrome_label.osm_ids))
AND aerodrome_type !=
CASE
%%FIELD_MAPPING: class %%
ELSE 'other' END;
$$ LANGUAGE SQL; $$ LANGUAGE SQL;
SELECT update_aerodrome_label_point(true); SELECT update_aerodrome_label_point(true);