From eb7f6be45545cdb2db0afbe180864c9b0afb18c1 Mon Sep 17 00:00:00 2001 From: Tomas Pohanka Date: Tue, 16 Jan 2024 14:03:46 +0100 Subject: [PATCH] Adding source_ids column if not exists. (#1600) Adding source_ids column if not exist in the table - osm_transportation_merge_linestring_gen_z11 - osm_transportation_merge_linestring_gen_z8 - osm_transportation_name_linestring - osm_important_waterway_linestring --- layers/transportation/update_transportation_merge.sql | 4 ++++ layers/transportation_name/update_transportation_name.sql | 2 ++ layers/waterway/update_important_waterway.sql | 2 ++ 3 files changed, 8 insertions(+) diff --git a/layers/transportation/update_transportation_merge.sql b/layers/transportation/update_transportation_merge.sql index 8756df60..f72cca34 100644 --- a/layers/transportation/update_transportation_merge.sql +++ b/layers/transportation/update_transportation_merge.sql @@ -144,6 +144,8 @@ CREATE TABLE IF NOT EXISTS osm_transportation_merge_linestring_gen_z11( layer integer ); +ALTER TABLE osm_transportation_merge_linestring_gen_z11 ADD COLUMN IF NOT EXISTS source_ids bigint[]; + -- Create osm_transportation_merge_linestring_gen_z10 as a copy of osm_transportation_merge_linestring_gen_z11 but -- drop the "source_ids" column. This can be done because z10 and z9 tables are only simplified and not merged, -- therefore relations to sources are direct via the id column. @@ -459,6 +461,8 @@ CREATE TABLE IF NOT EXISTS osm_transportation_merge_linestring_gen_z8( z_order integer ); +ALTER TABLE osm_transportation_merge_linestring_gen_z8 ADD COLUMN IF NOT EXISTS source_ids bigint[]; + -- Create osm_transportation_merge_linestring_gen_z7 as a copy of osm_transportation_merge_linestring_gen_z8 but -- drop the "source_ids" column. This can be done because z7 to z5 tables are only simplified and not merged, -- therefore relations to sources are direct via the id column. diff --git a/layers/transportation_name/update_transportation_name.sql b/layers/transportation_name/update_transportation_name.sql index e6496d11..2a6d1eb5 100644 --- a/layers/transportation_name/update_transportation_name.sql +++ b/layers/transportation_name/update_transportation_name.sql @@ -61,6 +61,8 @@ CREATE TABLE IF NOT EXISTS osm_transportation_name_linestring( route_rank integer ); +ALTER TABLE osm_transportation_name_linestring ADD COLUMN IF NOT EXISTS source_ids bigint[]; + -- Create OneToMany-Relation-Table storing relations of a Merged-LineString in table -- osm_transportation_name_linestring to Source-LineStrings from tables osm_transportation_name_network, -- osm_shipway_linestring and osm_aerialway_linestring diff --git a/layers/waterway/update_important_waterway.sql b/layers/waterway/update_important_waterway.sql index 134fdaf7..aa0105ea 100644 --- a/layers/waterway/update_important_waterway.sql +++ b/layers/waterway/update_important_waterway.sql @@ -27,6 +27,8 @@ CREATE TABLE IF NOT EXISTS osm_important_waterway_linestring ( tags hstore ); +ALTER TABLE osm_important_waterway_linestring ADD COLUMN IF NOT EXISTS source_ids bigint[]; + -- Create osm_important_waterway_linestring_gen_z11 as a copy of osm_important_waterway_linestring but drop the -- "source_ids" column. This can be done because z10 and z9 tables are only simplified and not merged, therefore -- relations to sources are direct via the id column.