]> git.openstreetmap.org Git - nominatim.git/blobdiff - sql/tables.sql
/hierarchy.php was missing namespace calling AddressDetails
[nominatim.git] / sql / tables.sql
index 98bf0c02599d90b95ce5c18d8259a041106c5628..0559abd4a869342a4860a3a94e09cb153cb9954e 100644 (file)
@@ -10,7 +10,7 @@ drop table if exists import_osmosis_log;
 CREATE TABLE import_osmosis_log (
   batchend timestamp,
   batchseq integer,
-  batchsize integer,
+  batchsize bigint,
   starttime timestamp,
   endtime timestamp,
   event text
@@ -36,6 +36,7 @@ GRANT SELECT ON new_query_log TO "{www-user}" ;
 
 GRANT SELECT ON TABLE country_name TO "{www-user}";
 GRANT SELECT ON TABLE gb_postcode TO "{www-user}";
+GRANT SELECT ON TABLE us_postcode TO "{www-user}";
 
 drop table IF EXISTS word;
 CREATE TABLE word (
@@ -69,6 +70,15 @@ CREATE TABLE location_area (
 
 CREATE TABLE location_area_large () INHERITS (location_area);
 
+DROP TABLE IF EXISTS location_area_country;
+CREATE TABLE location_area_country (
+  place_id BIGINT,
+  country_code varchar(2),
+  geometry GEOMETRY(Geometry, 4326)
+  ) {ts:address-data};
+CREATE INDEX idx_location_area_country_geometry ON location_area_country USING GIST (geometry) {ts:address-index};
+
+
 drop table IF EXISTS location_property CASCADE;
 CREATE TABLE location_property (
   place_id BIGINT,
@@ -212,6 +222,7 @@ CREATE TABLE location_postcode (
   geometry GEOMETRY(Geometry, 4326)
   );
 CREATE INDEX idx_postcode_geometry ON location_postcode USING GIST (geometry) {ts:address-index};
+GRANT SELECT ON location_postcode TO "{www-user}" ;
 
 CREATE TRIGGER location_postcode_before_update BEFORE UPDATE ON location_postcode
     FOR EACH ROW EXECUTE PROCEDURE postcode_update();
@@ -226,8 +237,8 @@ CREATE TABLE import_polygon_error (
   country_code varchar(2),
   updated timestamp,
   errormessage text,
-  prevgeometry GEOMTRY(Geometry, 4326),
-  newgeometry GEOMTRY(Geometry, 4326)
+  prevgeometry GEOMETRY(Geometry, 4326),
+  newgeometry GEOMETRY(Geometry, 4326)
   );
 CREATE INDEX idx_import_polygon_error_osmid ON import_polygon_error USING BTREE (osm_type, osm_id);
 GRANT SELECT ON import_polygon_error TO "{www-user}";