-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathschema.sql
49 lines (40 loc) · 950 Bytes
/
schema.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
48
49
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS hstore;
CREATE TABLE coordinates(
id serial PRIMARY KEY,
entity_id TEXT NOT NULL,
globe TEXT default NULL,
precision double precision,
latitude double precision,
longitude double precision
);
SELECT AddGeometryColumn ('public', 'coordinates', 'geom', 4326, 'POINT', 2);
CREATE TABLE value_snaks(
id serial PRIMARY KEY,
entity_id VARCHAR,
values HSTORE
);
CREATE INDEX on value_snaks(entity_id);
CREATE TABLE terms(
id serial PRIMARY KEY,
entity_id TEXT NOT NULL,
term_type TEXT,
term_language TEXT,
term_text TEXT
);
CREATE INDEX on terms(entity_id);
CREATE TABLE descriptions(
id serial PRIMARY KEY,
entity_id TEXT NOT NULL,
term_language TEXT,
term_text TEXT
);
CREATE TABLE properties(
id serial PRIMARY KEY,
entity_id TEXT NOT NULL,
term_type TEXT,
term_language TEXT,
term_text TEXT,
data_type TEXT
);
CREATE INDEX on properties(entity_id);