1 -- SPDX-License-Identifier: GPL-2.0-only
3 -- This file is part of Nominatim. (https://nominatim.org)
5 -- Copyright (C) 2026 by the Nominatim developer community.
6 -- For a full list of authors see the git log.
8 DROP TABLE IF EXISTS location_area CASCADE;
9 CREATE TABLE location_area (
10 place_id BIGINT NOT NULL,
11 keywords INTEGER[] NOT NULL,
12 partition SMALLINT NOT NULL,
13 rank_search SMALLINT NOT NULL,
14 rank_address SMALLINT NOT NULL,
15 country_code VARCHAR(2),
16 isguess BOOL NOT NULL,
18 centroid GEOMETRY(Point, 4326) NOT NULL,
19 geometry GEOMETRY(Geometry, 4326) NOT NULL
22 CREATE TABLE location_area_large () INHERITS (location_area);
24 DROP TABLE IF EXISTS location_area_country;
25 CREATE TABLE location_area_country (
26 place_id BIGINT NOT NULL,
27 country_code varchar(2) NOT NULL,
28 geometry GEOMETRY(Geometry, 4326) NOT NULL
29 ) {{db.tablespace.address_data}};
31 CREATE INDEX idx_location_area_country_geometry ON location_area_country
32 USING GIST (geometry) {{db.tablespace.address_index}};