move postcode table setup to sql/

Also moves the call to the setup from the setup-db
step to the calculate-postcodes step. The tables also need
no longer be accessible by the webservice.
This commit is contained in:
Sarah Hoffmann
2021-02-08 11:48:45 +01:00
parent ca3283cbaa
commit 7dfe645b5f
5 changed files with 32 additions and 60 deletions

15
sql/postcode_tables.sql Normal file
View File

@@ -0,0 +1,15 @@
DROP TABLE IF EXISTS gb_postcode;
CREATE TABLE gb_postcode (
id integer,
postcode character varying(9),
geometry geometry,
CONSTRAINT enforce_dims_geometry CHECK ((st_ndims(geometry) = 2)),
CONSTRAINT enforce_srid_geometry CHECK ((st_srid(geometry) = 4326))
);
DROP TABLE IF EXISTS us_postcode;
CREATE TABLE us_postcode (
postcode text,
x double precision,
y double precision
);

View File

@@ -35,8 +35,6 @@ GRANT UPDATE ON new_query_log TO "{www-user}" ;
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 (