Added entity postcode lookup

This commit is contained in:
Finn 2019-07-12 21:30:34 +01:00
parent cc84dbb76e
commit a45c354834
No known key found for this signature in database
GPG key ID: 7455B4B17685B598
12 changed files with 4793 additions and 1 deletions

View file

@ -0,0 +1,25 @@
-- Convert schema 'share/ddl/_source/deploy/27/001-auto.yml' to 'share/ddl/_source/deploy/28/001-auto.yml':;
;
BEGIN;
;
CREATE TABLE entities_postcodes (
outcode char(4) NOT NULL,
incode char(3) NOT NULL,
entity_id integer NOT NULL,
PRIMARY KEY (outcode, incode, entity_id),
FOREIGN KEY (entity_id) REFERENCES entities(id) ON DELETE CASCADE,
FOREIGN KEY (outcode, incode) REFERENCES gb_postcodes(outcode, incode)
);
;
CREATE INDEX entities_postcodes_idx_entity_id ON entities_postcodes (entity_id);
;
CREATE INDEX entities_postcodes_idx_outcode_incode ON entities_postcodes (outcode, incode);
;
COMMIT;