-
Notifications
You must be signed in to change notification settings - Fork 1
/
entities.sql
47 lines (43 loc) · 1.39 KB
/
entities.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
CREATE TABLE IF NOT EXISTS aq_cons_sector (
id_entity character varying(64) NOT NULL,
dateModified timestamp without time zone,
location geometry(MultiPolygon, 4326),
usage text,
name text
);
CREATE TABLE IF NOT EXISTS aq_cons_plot (
id_entity character varying(64) NOT NULL,
dateModified timestamp without time zone,
location geometry(MultiPolygon, 4326),
refSector character varying(64) NOT NULL,
description jsonb,
area double precision NOT NULL,
floors integer NOT NULL
);
CREATE TABLE IF NOT EXISTS aq_cons_const (
id_entity character varying(64) NOT NULL,
dateModified timestamp without time zone,
location geometry(Point, 4326), -- A POINT INSIDE ITS PLOT
refSector character varying(64) NOT NULL,
refPlot character varying(64) NOT NULL,
name text,
floor integer,
completePlot boolean NOT NULL,
usage text,
flow double precision,
pressure double precision
);
CREATE TABLE IF NOT EXISTS aq_aux_const_futu (
id_entity character varying(64) NOT NULL, -- SAME id_entity AS ITS CURRENT CONSTRUCTION
dateModified timestamp without time zone,
flow double precision,
pressure double precision
);
CREATE TABLE IF NOT EXISTS aq_aux_leak (
id_entity character varying(64) NOT NULL, -- SAME id_entity AS ITS SECTOR
dateModified timestamp without time zone,
isLeakage boolean,
duration integer,
flowPerc double precision,
pressurePerc double precision
);