-
Notifications
You must be signed in to change notification settings - Fork 1
/
coresmokedb.sql
692 lines (469 loc) · 17.1 KB
/
coresmokedb.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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
--
-- PostgreSQL database dump
--
-- Dumped from database version 14.12 (Ubuntu 14.12-1.pgdg22.04+1)
-- Dumped by pg_dump version 14.12 (Homebrew)
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;
DROP DATABASE coresmokedb;
--
-- Name: coresmokedb; Type: DATABASE; Schema: -; Owner: coresmokedb
--
CREATE DATABASE coresmokedb WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE = 'en_US.UTF-8';
ALTER DATABASE coresmokedb OWNER TO coresmokedb;
\connect coresmokedb
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;
--
-- Name: git_describe_as_plevel(character varying); Type: FUNCTION; Schema: public; Owner: coresmokedb
--
CREATE FUNCTION public.git_describe_as_plevel(character varying) RETURNS character varying
LANGUAGE plpgsql IMMUTABLE
AS $_$
declare
vparts varchar array [5];
plevel varchar;
clean varchar;
begin
select regexp_replace($1, E'^v', '') into clean;
select regexp_replace(clean, E'-g\.\+$', '') into clean;
select regexp_split_to_array(clean, E'[\.\-]') into vparts;
select vparts[1] || '.' into plevel;
select plevel || lpad(vparts[2], 3, '0') into plevel;
select plevel || lpad(vparts[3], 3, '0') into plevel;
if array_length(vparts, 1) = 3 then
select array_append(vparts, '0') into vparts;
end if;
if regexp_matches(vparts[4], 'RC') = array['RC'] then
select plevel || vparts[4] into plevel;
else
select plevel || 'zzz' into plevel;
end if;
select plevel || lpad(vparts[array_upper(vparts, 1)], 3, '0') into plevel;
return plevel;
end;
$_$;
ALTER FUNCTION public.git_describe_as_plevel(character varying) OWNER TO coresmokedb;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: config; Type: TABLE; Schema: public; Owner: coresmokedb
--
CREATE TABLE public.config (
id integer NOT NULL,
report_id integer NOT NULL,
arguments character varying NOT NULL,
debugging character varying NOT NULL,
started timestamp with time zone,
duration integer,
cc character varying,
ccversion character varying
);
ALTER TABLE public.config OWNER TO coresmokedb;
--
-- Name: config_id_seq; Type: SEQUENCE; Schema: public; Owner: coresmokedb
--
CREATE SEQUENCE public.config_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.config_id_seq OWNER TO coresmokedb;
--
-- Name: config_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: coresmokedb
--
ALTER SEQUENCE public.config_id_seq OWNED BY public.config.id;
--
-- Name: failure; Type: TABLE; Schema: public; Owner: coresmokedb
--
CREATE TABLE public.failure (
id integer NOT NULL,
test character varying NOT NULL,
status character varying NOT NULL,
extra character varying
);
ALTER TABLE public.failure OWNER TO coresmokedb;
--
-- Name: failure_id_seq; Type: SEQUENCE; Schema: public; Owner: coresmokedb
--
CREATE SEQUENCE public.failure_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.failure_id_seq OWNER TO coresmokedb;
--
-- Name: failure_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: coresmokedb
--
ALTER SEQUENCE public.failure_id_seq OWNED BY public.failure.id;
--
-- Name: failures_for_env; Type: TABLE; Schema: public; Owner: coresmokedb
--
CREATE TABLE public.failures_for_env (
result_id integer NOT NULL,
failure_id integer NOT NULL
);
ALTER TABLE public.failures_for_env OWNER TO coresmokedb;
--
-- Name: report; Type: TABLE; Schema: public; Owner: coresmokedb
--
CREATE TABLE public.report (
id integer NOT NULL,
sconfig_id integer,
duration integer,
config_count integer,
reporter character varying,
reporter_version character varying,
smoke_perl character varying,
smoke_revision character varying,
smoke_version character varying,
smoker_version character varying,
smoke_date timestamp with time zone NOT NULL,
perl_id character varying NOT NULL,
git_id character varying NOT NULL,
git_describe character varying NOT NULL,
applied_patches character varying,
hostname character varying NOT NULL,
architecture character varying NOT NULL,
osname character varying NOT NULL,
osversion character varying NOT NULL,
cpu_count character varying,
cpu_description character varying,
username character varying,
test_jobs character varying,
lc_all character varying,
lang character varying,
user_note character varying,
manifest_msgs bytea,
compiler_msgs bytea,
skipped_tests character varying,
log_file bytea,
out_file bytea,
harness_only character varying,
harness3opts character varying,
summary character varying NOT NULL,
smoke_branch character varying DEFAULT 'blead'::character varying,
nonfatal_msgs bytea,
plevel character varying GENERATED ALWAYS AS (public.git_describe_as_plevel(git_describe)) STORED
);
ALTER TABLE public.report OWNER TO coresmokedb;
--
-- Name: report_id_seq; Type: SEQUENCE; Schema: public; Owner: coresmokedb
--
CREATE SEQUENCE public.report_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.report_id_seq OWNER TO coresmokedb;
--
-- Name: report_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: coresmokedb
--
ALTER SEQUENCE public.report_id_seq OWNED BY public.report.id;
--
-- Name: result; Type: TABLE; Schema: public; Owner: coresmokedb
--
CREATE TABLE public.result (
id integer NOT NULL,
config_id integer NOT NULL,
io_env character varying NOT NULL,
locale character varying,
summary character varying NOT NULL,
statistics character varying,
stat_cpu_time double precision,
stat_tests integer
);
ALTER TABLE public.result OWNER TO coresmokedb;
--
-- Name: result_id_seq; Type: SEQUENCE; Schema: public; Owner: coresmokedb
--
CREATE SEQUENCE public.result_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.result_id_seq OWNER TO coresmokedb;
--
-- Name: result_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: coresmokedb
--
ALTER SEQUENCE public.result_id_seq OWNED BY public.result.id;
--
-- Name: smoke_config; Type: TABLE; Schema: public; Owner: coresmokedb
--
CREATE TABLE public.smoke_config (
id integer NOT NULL,
md5 character varying NOT NULL,
config character varying
);
ALTER TABLE public.smoke_config OWNER TO coresmokedb;
--
-- Name: smoke_config_id_seq; Type: SEQUENCE; Schema: public; Owner: coresmokedb
--
CREATE SEQUENCE public.smoke_config_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.smoke_config_id_seq OWNER TO coresmokedb;
--
-- Name: smoke_config_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: coresmokedb
--
ALTER SEQUENCE public.smoke_config_id_seq OWNED BY public.smoke_config.id;
--
-- Name: tsgateway_config; Type: TABLE; Schema: public; Owner: tsgateway
--
CREATE TABLE public.tsgateway_config (
id integer NOT NULL,
name character varying NOT NULL,
value character varying
);
ALTER TABLE public.tsgateway_config OWNER TO tsgateway;
--
-- Name: tsgateway_config_id_seq; Type: SEQUENCE; Schema: public; Owner: tsgateway
--
CREATE SEQUENCE public.tsgateway_config_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.tsgateway_config_id_seq OWNER TO tsgateway;
--
-- Name: tsgateway_config_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: tsgateway
--
ALTER SEQUENCE public.tsgateway_config_id_seq OWNED BY public.tsgateway_config.id;
--
-- Name: config id; Type: DEFAULT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.config ALTER COLUMN id SET DEFAULT nextval('public.config_id_seq'::regclass);
--
-- Name: failure id; Type: DEFAULT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.failure ALTER COLUMN id SET DEFAULT nextval('public.failure_id_seq'::regclass);
--
-- Name: report id; Type: DEFAULT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.report ALTER COLUMN id SET DEFAULT nextval('public.report_id_seq'::regclass);
--
-- Name: result id; Type: DEFAULT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.result ALTER COLUMN id SET DEFAULT nextval('public.result_id_seq'::regclass);
--
-- Name: smoke_config id; Type: DEFAULT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.smoke_config ALTER COLUMN id SET DEFAULT nextval('public.smoke_config_id_seq'::regclass);
--
-- Name: tsgateway_config id; Type: DEFAULT; Schema: public; Owner: tsgateway
--
ALTER TABLE ONLY public.tsgateway_config ALTER COLUMN id SET DEFAULT nextval('public.tsgateway_config_id_seq'::regclass);
--
-- Name: config config_pkey; Type: CONSTRAINT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.config
ADD CONSTRAINT config_pkey PRIMARY KEY (id);
--
-- Name: failure failure_pkey; Type: CONSTRAINT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.failure
ADD CONSTRAINT failure_pkey PRIMARY KEY (id);
--
-- Name: failure failure_test_status_extra_key; Type: CONSTRAINT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.failure
ADD CONSTRAINT failure_test_status_extra_key UNIQUE (test, status, extra);
--
-- Name: failures_for_env failures_for_env_result_id_failure_id_key; Type: CONSTRAINT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.failures_for_env
ADD CONSTRAINT failures_for_env_result_id_failure_id_key UNIQUE (result_id, failure_id);
--
-- Name: report report_git_id_smoke_date_duration_hostname_architecture_key; Type: CONSTRAINT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.report
ADD CONSTRAINT report_git_id_smoke_date_duration_hostname_architecture_key UNIQUE (git_id, smoke_date, duration, hostname, architecture);
--
-- Name: report report_pkey; Type: CONSTRAINT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.report
ADD CONSTRAINT report_pkey PRIMARY KEY (id);
--
-- Name: result result_pkey; Type: CONSTRAINT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.result
ADD CONSTRAINT result_pkey PRIMARY KEY (id);
--
-- Name: smoke_config smoke_config_md5_key; Type: CONSTRAINT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.smoke_config
ADD CONSTRAINT smoke_config_md5_key UNIQUE (md5);
--
-- Name: smoke_config smoke_config_pkey; Type: CONSTRAINT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.smoke_config
ADD CONSTRAINT smoke_config_pkey PRIMARY KEY (id);
--
-- Name: tsgateway_config tsgateway_config_name_key; Type: CONSTRAINT; Schema: public; Owner: tsgateway
--
ALTER TABLE ONLY public.tsgateway_config
ADD CONSTRAINT tsgateway_config_name_key UNIQUE (name);
--
-- Name: tsgateway_config tsgateway_config_pkey; Type: CONSTRAINT; Schema: public; Owner: tsgateway
--
ALTER TABLE ONLY public.tsgateway_config
ADD CONSTRAINT tsgateway_config_pkey PRIMARY KEY (id);
--
-- Name: report_architecture_idx; Type: INDEX; Schema: public; Owner: coresmokedb
--
CREATE INDEX report_architecture_idx ON public.report USING btree (architecture);
--
-- Name: report_hostname_idx; Type: INDEX; Schema: public; Owner: coresmokedb
--
CREATE INDEX report_hostname_idx ON public.report USING btree (hostname);
--
-- Name: report_osname_idx; Type: INDEX; Schema: public; Owner: coresmokedb
--
CREATE INDEX report_osname_idx ON public.report USING btree (osname);
--
-- Name: report_osversion_idx; Type: INDEX; Schema: public; Owner: coresmokedb
--
CREATE INDEX report_osversion_idx ON public.report USING btree (osversion);
--
-- Name: report_perl_id_idx; Type: INDEX; Schema: public; Owner: coresmokedb
--
CREATE INDEX report_perl_id_idx ON public.report USING btree (perl_id);
--
-- Name: report_plevel_hostname_idx; Type: INDEX; Schema: public; Owner: coresmokedb
--
CREATE INDEX report_plevel_hostname_idx ON public.report USING btree (hostname, plevel);
--
-- Name: report_plevel_idx; Type: INDEX; Schema: public; Owner: coresmokedb
--
CREATE INDEX report_plevel_idx ON public.report USING btree (plevel);
--
-- Name: report_smoke_date_idx; Type: INDEX; Schema: public; Owner: coresmokedb
--
CREATE INDEX report_smoke_date_idx ON public.report USING btree (smoke_date);
--
-- Name: report_smokedate_hostname_idx; Type: INDEX; Schema: public; Owner: coresmokedb
--
CREATE INDEX report_smokedate_hostname_idx ON public.report USING btree (hostname, smoke_date);
--
-- Name: report_smokedate_plevel_hostname_idx; Type: INDEX; Schema: public; Owner: coresmokedb
--
CREATE INDEX report_smokedate_plevel_hostname_idx ON public.report USING btree (hostname, plevel, smoke_date);
--
-- Name: config config_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.config
ADD CONSTRAINT config_report_id_fkey FOREIGN KEY (report_id) REFERENCES public.report(id);
--
-- Name: failures_for_env failures_for_env_failure_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.failures_for_env
ADD CONSTRAINT failures_for_env_failure_id_fkey FOREIGN KEY (failure_id) REFERENCES public.failure(id);
--
-- Name: failures_for_env failures_for_env_result_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.failures_for_env
ADD CONSTRAINT failures_for_env_result_id_fkey FOREIGN KEY (result_id) REFERENCES public.result(id);
--
-- Name: report report_sconfig_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.report
ADD CONSTRAINT report_sconfig_id_fkey FOREIGN KEY (sconfig_id) REFERENCES public.smoke_config(id);
--
-- Name: result result_config_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: coresmokedb
--
ALTER TABLE ONLY public.result
ADD CONSTRAINT result_config_id_fkey FOREIGN KEY (config_id) REFERENCES public.config(id);
--
-- Name: TABLE config; Type: ACL; Schema: public; Owner: coresmokedb
--
GRANT SELECT,INSERT,UPDATE ON TABLE public.config TO tsgateway;
GRANT SELECT ON TABLE public.config TO backup;
--
-- Name: SEQUENCE config_id_seq; Type: ACL; Schema: public; Owner: coresmokedb
--
GRANT USAGE ON SEQUENCE public.config_id_seq TO tsgateway;
--
-- Name: TABLE failure; Type: ACL; Schema: public; Owner: coresmokedb
--
GRANT SELECT,INSERT,UPDATE ON TABLE public.failure TO tsgateway;
GRANT SELECT ON TABLE public.failure TO backup;
--
-- Name: SEQUENCE failure_id_seq; Type: ACL; Schema: public; Owner: coresmokedb
--
GRANT USAGE ON SEQUENCE public.failure_id_seq TO tsgateway;
--
-- Name: TABLE failures_for_env; Type: ACL; Schema: public; Owner: coresmokedb
--
GRANT SELECT,INSERT,UPDATE ON TABLE public.failures_for_env TO tsgateway;
GRANT SELECT ON TABLE public.failures_for_env TO backup;
--
-- Name: TABLE report; Type: ACL; Schema: public; Owner: coresmokedb
--
GRANT SELECT,INSERT,UPDATE ON TABLE public.report TO tsgateway;
GRANT SELECT ON TABLE public.report TO backup;
--
-- Name: SEQUENCE report_id_seq; Type: ACL; Schema: public; Owner: coresmokedb
--
GRANT USAGE ON SEQUENCE public.report_id_seq TO tsgateway;
--
-- Name: TABLE result; Type: ACL; Schema: public; Owner: coresmokedb
--
GRANT SELECT,INSERT,UPDATE ON TABLE public.result TO tsgateway;
GRANT SELECT ON TABLE public.result TO backup;
--
-- Name: SEQUENCE result_id_seq; Type: ACL; Schema: public; Owner: coresmokedb
--
GRANT USAGE ON SEQUENCE public.result_id_seq TO tsgateway;
--
-- Name: TABLE smoke_config; Type: ACL; Schema: public; Owner: coresmokedb
--
GRANT SELECT,INSERT,UPDATE ON TABLE public.smoke_config TO tsgateway;
GRANT SELECT ON TABLE public.smoke_config TO backup;
--
-- Name: SEQUENCE smoke_config_id_seq; Type: ACL; Schema: public; Owner: coresmokedb
--
GRANT USAGE ON SEQUENCE public.smoke_config_id_seq TO tsgateway;
--
-- Name: TABLE tsgateway_config; Type: ACL; Schema: public; Owner: tsgateway
--
GRANT SELECT ON TABLE public.tsgateway_config TO backup;
--
-- PostgreSQL database dump complete
--
-- Handcrafted: pg_dump -d -t '*_seq' coresmokedb | grep SELECT | grep setval
SELECT pg_catalog.setval('public.config_id_seq', 550000, true);
SELECT pg_catalog.setval('public.failure_id_seq', 5000, true);
SELECT pg_catalog.setval('public.report_id_seq', 5500000, true);
SELECT pg_catalog.setval('public.result_id_seq', 850000, true);
SELECT pg_catalog.setval('public.smoke_config_id_seq', 1, true);
SELECT pg_catalog.setval('public.tsgateway_config_id_seq', 1, true);