-
Notifications
You must be signed in to change notification settings - Fork 9
/
create.sql
298 lines (210 loc) · 6.49 KB
/
create.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.12
-- Dumped by pg_dump version 12.12
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: artifact; Type: TABLE; Schema: public; Owner: cfbot
--
CREATE TABLE public.artifact (
task_id text NOT NULL,
name text NOT NULL,
path text NOT NULL,
size integer NOT NULL,
body text
);
ALTER TABLE public.artifact OWNER TO cfbot;
--
-- Name: branch; Type: TABLE; Schema: public; Owner: cfbot
--
CREATE TABLE public.branch (
id integer NOT NULL,
commitfest_id integer NOT NULL,
submission_id integer NOT NULL,
commit_id text,
status text NOT NULL,
url text,
created timestamp with time zone NOT NULL,
modified timestamp with time zone NOT NULL
);
ALTER TABLE public.branch OWNER TO cfbot;
--
-- Name: branch_id_seq; Type: SEQUENCE; Schema: public; Owner: cfbot
--
CREATE SEQUENCE public.branch_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.branch_id_seq OWNER TO cfbot;
--
-- Name: branch_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: cfbot
--
ALTER SEQUENCE public.branch_id_seq OWNED BY public.branch.id;
--
-- Name: highlight; Type: TABLE; Schema: public; Owner: cfbot
--
CREATE TABLE public.highlight (
task_id text NOT NULL,
type text NOT NULL,
source text NOT NULL,
excerpt text NOT NULL
);
ALTER TABLE public.highlight OWNER TO cfbot;
--
-- Name: submission; Type: TABLE; Schema: public; Owner: cfbot
--
CREATE TABLE public.submission (
commitfest_id integer NOT NULL,
submission_id integer NOT NULL,
name text NOT NULL,
status text NOT NULL,
authors text[] NOT NULL,
last_email_time timestamp with time zone,
last_email_time_checked timestamp with time zone,
last_message_id text,
last_branch_message_id text,
last_branch_commit_id text,
last_branch_time timestamp with time zone
);
ALTER TABLE public.submission OWNER TO cfbot;
--
-- Name: task; Type: TABLE; Schema: public; Owner: cfbot
--
CREATE TABLE public.task (
commitfest_id integer NOT NULL,
submission_id integer NOT NULL,
task_name text NOT NULL,
commit_id text,
status text NOT NULL,
created timestamp with time zone NOT NULL,
modified timestamp with time zone NOT NULL,
task_id text NOT NULL,
"position" integer NOT NULL
);
ALTER TABLE public.task OWNER TO cfbot;
--
-- Name: task_command; Type: TABLE; Schema: public; Owner: cfbot
--
CREATE TABLE public.task_command (
task_id text NOT NULL,
name text NOT NULL,
status text NOT NULL,
type text NOT NULL,
duration interval NOT NULL,
log text
);
ALTER TABLE public.task_command OWNER TO cfbot;
--
-- Name: test; Type: TABLE; Schema: public; Owner: cfbot
--
CREATE TABLE public.test (
task_id text NOT NULL,
command text NOT NULL,
type text NOT NULL,
suite text NOT NULL,
name text NOT NULL,
result text NOT NULL,
duration interval
);
ALTER TABLE public.test OWNER TO cfbot;
--
-- Name: work_queue; Type: TABLE; Schema: public; Owner: cfbot
--
CREATE TABLE public.work_queue (
id integer NOT NULL,
type text NOT NULL,
key text,
status text NOT NULL,
retries integer,
lease timestamp with time zone
);
ALTER TABLE public.work_queue OWNER TO cfbot;
--
-- Name: work_queue_id_seq; Type: SEQUENCE; Schema: public; Owner: cfbot
--
CREATE SEQUENCE public.work_queue_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.work_queue_id_seq OWNER TO cfbot;
--
-- Name: work_queue_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: cfbot
--
ALTER SEQUENCE public.work_queue_id_seq OWNED BY public.work_queue.id;
--
-- Name: branch id; Type: DEFAULT; Schema: public; Owner: cfbot
--
ALTER TABLE ONLY public.branch ALTER COLUMN id SET DEFAULT nextval('public.branch_id_seq'::regclass);
--
-- Name: work_queue id; Type: DEFAULT; Schema: public; Owner: cfbot
--
ALTER TABLE ONLY public.work_queue ALTER COLUMN id SET DEFAULT nextval('public.work_queue_id_seq'::regclass);
--
-- Name: artifact artifact_pkey; Type: CONSTRAINT; Schema: public; Owner: cfbot
--
ALTER TABLE ONLY public.artifact
ADD CONSTRAINT artifact_pkey PRIMARY KEY (task_id, name, path);
--
-- Name: branch branch_pkey; Type: CONSTRAINT; Schema: public; Owner: cfbot
--
ALTER TABLE ONLY public.branch
ADD CONSTRAINT branch_pkey PRIMARY KEY (id);
--
-- Name: submission submission_pkey; Type: CONSTRAINT; Schema: public; Owner: cfbot
--
ALTER TABLE ONLY public.submission
ADD CONSTRAINT submission_pkey PRIMARY KEY (commitfest_id, submission_id);
--
-- Name: task task_pkey; Type: CONSTRAINT; Schema: public; Owner: cfbot
--
ALTER TABLE ONLY public.task
ADD CONSTRAINT task_pkey PRIMARY KEY (task_id);
--
-- Name: test test_pkey1; Type: CONSTRAINT; Schema: public; Owner: cfbot
--
ALTER TABLE ONLY public.test
ADD CONSTRAINT test_pkey1 PRIMARY KEY (task_id, command, type, suite, name);
--
-- Name: work_queue work_queue_pkey; Type: CONSTRAINT; Schema: public; Owner: cfbot
--
ALTER TABLE ONLY public.work_queue
ADD CONSTRAINT work_queue_pkey PRIMARY KEY (id);
--
-- Name: highlight_task_id_type_idx; Type: INDEX; Schema: public; Owner: cfbot
--
CREATE INDEX highlight_task_id_type_idx ON public.highlight USING btree (task_id, type);
--
-- Name: task_command_task_id_name_idx; Type: INDEX; Schema: public; Owner: cfbot
--
CREATE INDEX task_command_task_id_name_idx ON public.task_command USING btree (task_id, name);
--
-- Name: branch branch_commitfest_id_submission_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cfbot
--
ALTER TABLE ONLY public.branch
ADD CONSTRAINT branch_commitfest_id_submission_id_fkey FOREIGN KEY (commitfest_id, submission_id) REFERENCES public.submission(commitfest_id, submission_id);
--
-- Name: task build_result_commitfest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cfbot
--
ALTER TABLE ONLY public.task
ADD CONSTRAINT build_result_commitfest_id_fkey FOREIGN KEY (commitfest_id, submission_id) REFERENCES public.submission(commitfest_id, submission_id);
--
-- PostgreSQL database dump complete
--