-
Notifications
You must be signed in to change notification settings - Fork 2
/
schema.sql
executable file
·130 lines (119 loc) · 3.09 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
DROP TABLE IF EXISTS video;
DROP TABLE IF EXISTS event;
DROP TABLE IF EXISTS issue;
DROP TABLE IF EXISTS article;
DROP TABLE IF EXISTS news;
DROP TABLE IF EXISTS push;
CREATE TABLE video (
uuid uuid NOT NULL,
status integer,
video_id text,
url text,
site text,
title text,
description text,
thumbnail_url text,
timestamp_creation timestamp with time zone,
timestamp_publish timestamp with time zone,
description_snippet text
);
CREATE UNIQUE INDEX index_video_uuid ON video (uuid);
CREATE UNIQUE INDEX index_video_id ON video (video_id);
CREATE TABLE event (
uuid uuid NOT NULL,
status integer,
event_id text,
event_id_obfuscated text,
url text,
name text,
date text,
start_time timestamp without time zone,
timezone text,
description text,
latitude double precision,
longitude double precision,
attendee_count integer,
capacity integer,
site text,
lang text,
event_type_name text,
venue_address1 text,
venue_address2 text,
venue_address3 text,
venue_name text,
venue_city text,
venue_state text,
venue_zip text,
timestamp_creation timestamp with time zone,
is_official boolean
);
CREATE UNIQUE INDEX index_event_uuid ON event (uuid);
CREATE UNIQUE INDEX index_event_id ON event (event_id);
CREATE TABLE issue (
uuid uuid NOT NULL,
status integer,
url text,
image_url text,
site text,
lang text,
title text,
article_type text,
body text,
body_markdown text,
description text,
timestamp_creation timestamp with time zone,
timestamp_publish timestamp with time zone
);
CREATE UNIQUE INDEX index_issue_uuid ON video (uuid);
CREATE UNIQUE INDEX index_issue_url ON video (url);
CREATE TABLE article (
uuid uuid NOT NULL,
status integer,
article_id text,
timestamp_creation timestamp with time zone,
timestamp_publish timestamp with time zone,
title text,
article_type text,
site text,
lang text,
excerpt text,
article_category text,
url text,
image_url text,
body text,
body_markdown text,
CONSTRAINT title_article_type UNIQUE (title, article_type) -- No duplicates with the same title and article type
);
CREATE UNIQUE INDEX index_article_uuid ON article (uuid);
CREATE UNIQUE INDEX index_article_id ON article (article_id);
CREATE TABLE news (
uuid uuid NOT NULL,
status integer,
news_id text,
timestamp_creation timestamp with time zone,
timestamp_publish timestamp with time zone,
title text,
news_type text,
site text,
lang text,
excerpt text,
news_category text,
url text,
image_url text,
body text,
body_markdown text
);
CREATE UNIQUE INDEX index_news_uuid ON news (uuid);
CREATE UNIQUE INDEX index_news_id ON news (news_id);
CREATE TABLE push (
uuid uuid NOT NULL,
status integer,
object_type text,
object_uuid uuid,
title text,
body text,
url text,
timestamp_creation timestamp with time zone,
timestamp_publish timestamp with time zone
);
CREATE UNIQUE INDEX index_push_uuid on push (uuid);