This repository has been archived by the owner on Jun 11, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
schema_68.sql
5235 lines (3542 loc) · 140 KB
/
schema_68.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
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'SQL_ASCII';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
--
-- Name: audit; Type: SCHEMA; Schema: -; Owner: dak
--
CREATE SCHEMA audit;
ALTER SCHEMA audit OWNER TO dak;
SET search_path = public, pg_catalog;
--
-- Name: bin_associations_id_max(); Type: FUNCTION; Schema: public; Owner: dak
--
CREATE FUNCTION bin_associations_id_max() RETURNS integer
LANGUAGE sql
AS $$SELECT max(id) FROM bin_associations$$;
ALTER FUNCTION public.bin_associations_id_max() OWNER TO dak;
--
-- Name: binaries_id_max(); Type: FUNCTION; Schema: public; Owner: dak
--
CREATE FUNCTION binaries_id_max() RETURNS integer
LANGUAGE sql
AS $$SELECT max(id) FROM binaries$$;
ALTER FUNCTION public.binaries_id_max() OWNER TO dak;
--
-- Name: dsc_files_id_max(); Type: FUNCTION; Schema: public; Owner: dak
--
CREATE FUNCTION dsc_files_id_max() RETURNS integer
LANGUAGE sql
AS $$SELECT max(id) FROM dsc_files$$;
ALTER FUNCTION public.dsc_files_id_max() OWNER TO dak;
--
-- Name: files_id_max(); Type: FUNCTION; Schema: public; Owner: dak
--
CREATE FUNCTION files_id_max() RETURNS integer
LANGUAGE sql
AS $$SELECT max(id) FROM files$$;
ALTER FUNCTION public.files_id_max() OWNER TO dak;
--
-- Name: override_type_id_max(); Type: FUNCTION; Schema: public; Owner: dak
--
CREATE FUNCTION override_type_id_max() RETURNS integer
LANGUAGE sql
AS $$SELECT max(id) FROM override_type$$;
ALTER FUNCTION public.override_type_id_max() OWNER TO dak;
--
-- Name: priority_id_max(); Type: FUNCTION; Schema: public; Owner: dak
--
CREATE FUNCTION priority_id_max() RETURNS integer
LANGUAGE sql
AS $$SELECT max(id) FROM priority$$;
ALTER FUNCTION public.priority_id_max() OWNER TO dak;
--
-- Name: section_id_max(); Type: FUNCTION; Schema: public; Owner: dak
--
CREATE FUNCTION section_id_max() RETURNS integer
LANGUAGE sql
AS $$SELECT max(id) FROM section$$;
ALTER FUNCTION public.section_id_max() OWNER TO dak;
--
-- Name: source_id_max(); Type: FUNCTION; Schema: public; Owner: dak
--
CREATE FUNCTION source_id_max() RETURNS integer
LANGUAGE sql
AS $$SELECT max(id) FROM source$$;
ALTER FUNCTION public.source_id_max() OWNER TO dak;
--
-- Name: space_concat(text, text); Type: FUNCTION; Schema: public; Owner: dak
--
CREATE FUNCTION space_concat(text, text) RETURNS text
LANGUAGE sql
AS $_$select case
WHEN $2 is null or $2 = '' THEN $1
WHEN $1 is null or $1 = '' THEN $2
ELSE $1 || ' ' || $2
END$_$;
ALTER FUNCTION public.space_concat(text, text) OWNER TO dak;
--
-- Name: src_associations_id_max(); Type: FUNCTION; Schema: public; Owner: dak
--
CREATE FUNCTION src_associations_id_max() RETURNS integer
LANGUAGE sql
AS $$SELECT max(id) FROM src_associations$$;
ALTER FUNCTION public.src_associations_id_max() OWNER TO dak;
--
-- Name: tfunc_set_modified(); Type: FUNCTION; Schema: public; Owner: dak
--
CREATE FUNCTION tfunc_set_modified() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN NEW.modified = now(); return NEW; END;
$$;
ALTER FUNCTION public.tfunc_set_modified() OWNER TO dak;
--
-- Name: trigger_binsrc_assoc_update(); Type: FUNCTION; Schema: public; Owner: dak
--
CREATE FUNCTION trigger_binsrc_assoc_update() RETURNS trigger
LANGUAGE plpgsql SECURITY DEFINER
SET search_path TO public, pg_temp
AS $$
DECLARE
v_data RECORD;
v_package audit.package_changes.package%TYPE;
v_version audit.package_changes.version%TYPE;
v_architecture audit.package_changes.architecture%TYPE;
v_suite audit.package_changes.suite%TYPE;
v_event audit.package_changes.event%TYPE;
v_priority audit.package_changes.priority%TYPE;
v_component audit.package_changes.component%TYPE;
v_section audit.package_changes.section%TYPE;
BEGIN
CASE TG_OP
WHEN 'INSERT' THEN v_event := 'I'; v_data := NEW;
WHEN 'DELETE' THEN v_event := 'D'; v_data := OLD;
ELSE RAISE EXCEPTION 'trigger called for invalid operation (%)', TG_OP;
END CASE;
SELECT suite_name INTO STRICT v_suite FROM suite WHERE id = v_data.suite;
CASE TG_TABLE_NAME
WHEN 'bin_associations' THEN
SELECT package, version, arch_string
INTO STRICT v_package, v_version, v_architecture
FROM binaries LEFT JOIN architecture ON (architecture.id = binaries.architecture)
WHERE binaries.id = v_data.bin;
SELECT component.name, priority.priority, section.section
INTO v_component, v_priority, v_section
FROM override
JOIN override_type ON (override.type = override_type.id)
JOIN priority ON (priority.id = override.priority)
JOIN section ON (section.id = override.section)
JOIN component ON (override.component = component.id)
JOIN suite ON (suite.id = override.suite)
WHERE override_type.type != 'dsc'
AND override.package = v_package AND suite.id = v_data.suite;
WHEN 'src_associations' THEN
SELECT source, version
INTO STRICT v_package, v_version
FROM source WHERE source.id = v_data.source;
v_architecture := 'source';
SELECT component.name, priority.priority, section.section
INTO v_component, v_priority, v_section
FROM override
JOIN override_type ON (override.type = override_type.id)
JOIN priority ON (priority.id = override.priority)
JOIN section ON (section.id = override.section)
JOIN component ON (override.component = component.id)
JOIN suite ON (suite.id = override.suite)
WHERE override_type.type = 'dsc'
AND override.package = v_package AND suite.id = v_data.suite;
ELSE RAISE EXCEPTION 'trigger called for invalid table (%)', TG_TABLE_NAME;
END CASE;
INSERT INTO audit.package_changes
(package, version, architecture, suite, event, priority, component, section)
VALUES (v_package, v_version, v_architecture, v_suite, v_event, v_priority, v_component, v_section);
RETURN NEW;
END;
$$;
ALTER FUNCTION public.trigger_binsrc_assoc_update() OWNER TO dak;
--
-- Name: trigger_override_update(); Type: FUNCTION; Schema: public; Owner: dak
--
CREATE FUNCTION trigger_override_update() RETURNS trigger
LANGUAGE plpgsql SECURITY DEFINER
SET search_path TO public, pg_temp
AS $$
DECLARE
v_src_override_id override_type.id%TYPE;
v_priority audit.package_changes.priority%TYPE := NULL;
v_component audit.package_changes.component%TYPE := NULL;
v_section audit.package_changes.section%TYPE := NULL;
BEGIN
IF TG_TABLE_NAME != 'override' THEN
RAISE EXCEPTION 'trigger called for invalid table (%)', TG_TABLE_NAME;
END IF;
IF TG_OP != 'UPDATE' THEN
RAISE EXCEPTION 'trigger called for invalid event (%)', TG_OP;
END IF;
IF OLD.package != NEW.package OR OLD.type != NEW.type OR OLD.suite != NEW.suite THEN
RETURN NEW;
END IF;
IF OLD.priority != NEW.priority THEN
SELECT priority INTO STRICT v_priority FROM priority WHERE id = NEW.priority;
END IF;
IF OLD.component != NEW.component THEN
SELECT name INTO STRICT v_component FROM component WHERE id = NEW.component;
END IF;
IF OLD.section != NEW.section THEN
SELECT section INTO STRICT v_section FROM section WHERE id = NEW.section;
END IF;
-- Find out if we're doing src or binary overrides
SELECT id INTO STRICT v_src_override_id FROM override_type WHERE type = 'dsc';
IF OLD.type = v_src_override_id THEN
-- Doing a src_association link
INSERT INTO audit.package_changes
(package, version, architecture, suite, event, priority, component, section)
SELECT NEW.package, source.version, 'source', suite.suite_name, 'U', v_priority, v_component, v_section
FROM source
JOIN src_associations ON (source.id = src_associations.source)
JOIN suite ON (suite.id = src_associations.suite)
WHERE source.source = NEW.package AND src_associations.suite = NEW.suite;
ELSE
-- Doing a bin_association link
INSERT INTO audit.package_changes
(package, version, architecture, suite, event, priority, component, section)
SELECT NEW.package, binaries.version, architecture.arch_string, suite.suite_name, 'U', v_priority, v_component, v_section
FROM binaries
JOIN bin_associations ON (binaries.id = bin_associations.bin)
JOIN architecture ON (architecture.id = binaries.architecture)
JOIN suite ON (suite.id = bin_associations.suite)
WHERE binaries.package = NEW.package AND bin_associations.suite = NEW.suite;
END IF;
RETURN NEW;
END;
$$;
ALTER FUNCTION public.trigger_override_update() OWNER TO dak;
SET search_path = audit, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: package_changes; Type: TABLE; Schema: audit; Owner: dak; Tablespace:
--
CREATE TABLE package_changes (
changedate timestamp without time zone DEFAULT now() NOT NULL,
package text NOT NULL,
version public.debversion NOT NULL,
architecture text NOT NULL,
suite text NOT NULL,
event text NOT NULL,
priority text,
component text,
section text
);
ALTER TABLE audit.package_changes OWNER TO dak;
SET search_path = public, pg_catalog;
--
-- Name: bin_associations_id_seq; Type: SEQUENCE; Schema: public; Owner: dak
--
CREATE SEQUENCE bin_associations_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.bin_associations_id_seq OWNER TO dak;
--
-- Name: bin_associations; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE bin_associations (
id integer DEFAULT nextval('bin_associations_id_seq'::regclass) NOT NULL,
suite integer NOT NULL,
bin integer NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL,
modified timestamp with time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.bin_associations OWNER TO dak;
--
-- Name: binaries_id_seq; Type: SEQUENCE; Schema: public; Owner: dak
--
CREATE SEQUENCE binaries_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.binaries_id_seq OWNER TO dak;
--
-- Name: binaries; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE binaries (
id integer DEFAULT nextval('binaries_id_seq'::regclass) NOT NULL,
package text NOT NULL,
version debversion NOT NULL,
maintainer integer NOT NULL,
source integer NOT NULL,
architecture integer NOT NULL,
file integer NOT NULL,
type text NOT NULL,
sig_fpr integer,
install_date timestamp with time zone DEFAULT now(),
created timestamp with time zone DEFAULT now() NOT NULL,
modified timestamp with time zone DEFAULT now() NOT NULL,
stanza text
);
ALTER TABLE public.binaries OWNER TO dak;
--
-- Name: bin_associations_binaries; Type: VIEW; Schema: public; Owner: dak
--
CREATE VIEW bin_associations_binaries AS
SELECT bin_associations.id, bin_associations.bin, binaries.package, binaries.version, bin_associations.suite, binaries.architecture, binaries.source FROM (bin_associations JOIN binaries ON ((bin_associations.bin = binaries.id)));
ALTER TABLE public.bin_associations_binaries OWNER TO dak;
--
-- Name: source_id_seq; Type: SEQUENCE; Schema: public; Owner: dak
--
CREATE SEQUENCE source_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.source_id_seq OWNER TO dak;
--
-- Name: source; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE source (
id integer DEFAULT nextval('source_id_seq'::regclass) NOT NULL,
source text NOT NULL,
version debversion NOT NULL,
maintainer integer NOT NULL,
file integer NOT NULL,
sig_fpr integer,
install_date timestamp with time zone NOT NULL,
changedby integer NOT NULL,
dm_upload_allowed boolean DEFAULT false NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL,
modified timestamp with time zone DEFAULT now() NOT NULL,
stanza text
);
ALTER TABLE public.source OWNER TO dak;
--
-- Name: src_associations_id_seq; Type: SEQUENCE; Schema: public; Owner: dak
--
CREATE SEQUENCE src_associations_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.src_associations_id_seq OWNER TO dak;
--
-- Name: src_associations; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE src_associations (
id integer DEFAULT nextval('src_associations_id_seq'::regclass) NOT NULL,
suite integer NOT NULL,
source integer NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL,
modified timestamp with time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.src_associations OWNER TO dak;
--
-- Name: src_associations_bin; Type: VIEW; Schema: public; Owner: dak
--
CREATE VIEW src_associations_bin AS
SELECT src_associations.id, src_associations.source, src_associations.suite, binaries.id AS bin, binaries.architecture FROM ((src_associations JOIN source ON ((src_associations.source = source.id))) JOIN binaries ON ((source.id = binaries.source)));
ALTER TABLE public.src_associations_bin OWNER TO dak;
--
-- Name: almost_obsolete_all_associations; Type: VIEW; Schema: public; Owner: dak
--
CREATE VIEW almost_obsolete_all_associations AS
SELECT bin_associations_binaries.id, bin_associations_binaries.bin, bin_associations_binaries.package, bin_associations_binaries.version, bin_associations_binaries.suite FROM (bin_associations_binaries LEFT JOIN src_associations_bin USING (bin, suite, architecture)) WHERE ((src_associations_bin.source IS NULL) AND (bin_associations_binaries.architecture = 2));
ALTER TABLE public.almost_obsolete_all_associations OWNER TO dak;
--
-- Name: any_associations_source; Type: VIEW; Schema: public; Owner: dak
--
CREATE VIEW any_associations_source AS
SELECT bin_associations.id, bin_associations.suite, binaries.id AS bin, binaries.package, binaries.version AS binver, binaries.architecture, source.id AS src, source.source, source.version AS srcver FROM ((bin_associations JOIN binaries ON (((bin_associations.bin = binaries.id) AND (binaries.architecture <> 2)))) JOIN source ON ((binaries.source = source.id)));
ALTER TABLE public.any_associations_source OWNER TO dak;
--
-- Name: src_associations_src; Type: VIEW; Schema: public; Owner: dak
--
CREATE VIEW src_associations_src AS
SELECT src_associations.id, src_associations.suite, source.id AS src, source.source, source.version FROM (src_associations JOIN source ON ((src_associations.source = source.id)));
ALTER TABLE public.src_associations_src OWNER TO dak;
--
-- Name: almost_obsolete_src_associations; Type: VIEW; Schema: public; Owner: dak
--
CREATE VIEW almost_obsolete_src_associations AS
SELECT src_associations_src.id, src_associations_src.src, src_associations_src.source, src_associations_src.version, src_associations_src.suite FROM (src_associations_src LEFT JOIN any_associations_source USING (src, suite)) WHERE (any_associations_source.bin IS NULL);
ALTER TABLE public.almost_obsolete_src_associations OWNER TO dak;
--
-- Name: architecture_id_seq; Type: SEQUENCE; Schema: public; Owner: dak
--
CREATE SEQUENCE architecture_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.architecture_id_seq OWNER TO dak;
--
-- Name: architecture; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE architecture (
id integer DEFAULT nextval('architecture_id_seq'::regclass) NOT NULL,
arch_string text NOT NULL,
description text,
created timestamp with time zone DEFAULT now() NOT NULL,
modified timestamp with time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.architecture OWNER TO dak;
--
-- Name: archive_id_seq; Type: SEQUENCE; Schema: public; Owner: dak
--
CREATE SEQUENCE archive_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.archive_id_seq OWNER TO dak;
--
-- Name: archive; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE archive (
id integer DEFAULT nextval('archive_id_seq'::regclass) NOT NULL,
name text NOT NULL,
origin_server text,
description text,
created timestamp with time zone DEFAULT now() NOT NULL,
modified timestamp with time zone DEFAULT now() NOT NULL,
primary_mirror text
);
ALTER TABLE public.archive OWNER TO dak;
--
-- Name: bin_contents; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE bin_contents (
file text NOT NULL,
binary_id integer NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL,
modified timestamp with time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.bin_contents OWNER TO dak;
--
-- Name: binaries_metadata; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE binaries_metadata (
bin_id integer NOT NULL,
key_id integer NOT NULL,
value text NOT NULL
);
ALTER TABLE public.binaries_metadata OWNER TO dak;
--
-- Name: suite_id_seq; Type: SEQUENCE; Schema: public; Owner: dak
--
CREATE SEQUENCE suite_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.suite_id_seq OWNER TO dak;
--
-- Name: suite; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE suite (
id integer DEFAULT nextval('suite_id_seq'::regclass) NOT NULL,
suite_name text NOT NULL,
version text,
origin text,
label text,
description text,
untouchable boolean DEFAULT false NOT NULL,
codename text,
overridecodename text,
validtime integer DEFAULT 604800 NOT NULL,
priority integer DEFAULT 0 NOT NULL,
notautomatic boolean DEFAULT false NOT NULL,
copychanges text,
overridesuite text,
policy_queue_id integer,
created timestamp with time zone DEFAULT now() NOT NULL,
modified timestamp with time zone DEFAULT now() NOT NULL,
changelog text,
butautomaticupgrades boolean DEFAULT false NOT NULL,
signingkeys text[],
announce text[],
CONSTRAINT bau_needs_na_set CHECK (((NOT butautomaticupgrades) OR notautomatic))
);
ALTER TABLE public.suite OWNER TO dak;
--
-- Name: binaries_suite_arch; Type: VIEW; Schema: public; Owner: dak
--
CREATE VIEW binaries_suite_arch AS
SELECT bin_associations.id, binaries.id AS bin, binaries.package, binaries.version, binaries.source, bin_associations.suite, suite.suite_name, binaries.architecture, architecture.arch_string FROM (((binaries JOIN bin_associations ON ((binaries.id = bin_associations.bin))) JOIN suite ON ((suite.id = bin_associations.suite))) JOIN architecture ON ((binaries.architecture = architecture.id)));
ALTER TABLE public.binaries_suite_arch OWNER TO dak;
--
-- Name: binary_acl; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE binary_acl (
id integer NOT NULL,
access_level text NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL,
modified timestamp with time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.binary_acl OWNER TO dak;
--
-- Name: binary_acl_id_seq; Type: SEQUENCE; Schema: public; Owner: dak
--
CREATE SEQUENCE binary_acl_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.binary_acl_id_seq OWNER TO dak;
--
-- Name: binary_acl_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dak
--
ALTER SEQUENCE binary_acl_id_seq OWNED BY binary_acl.id;
--
-- Name: binary_acl_map; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE binary_acl_map (
id integer NOT NULL,
fingerprint_id integer NOT NULL,
architecture_id integer NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL,
modified timestamp with time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.binary_acl_map OWNER TO dak;
--
-- Name: binary_acl_map_id_seq; Type: SEQUENCE; Schema: public; Owner: dak
--
CREATE SEQUENCE binary_acl_map_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.binary_acl_map_id_seq OWNER TO dak;
--
-- Name: binary_acl_map_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dak
--
ALTER SEQUENCE binary_acl_map_id_seq OWNED BY binary_acl_map.id;
--
-- Name: files_id_seq; Type: SEQUENCE; Schema: public; Owner: dak
--
CREATE SEQUENCE files_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.files_id_seq OWNER TO dak;
--
-- Name: files; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE files (
id integer DEFAULT nextval('files_id_seq'::regclass) NOT NULL,
filename text NOT NULL,
size bigint NOT NULL,
md5sum text NOT NULL,
location integer NOT NULL,
last_used timestamp with time zone,
sha1sum text,
sha256sum text,
created timestamp with time zone DEFAULT now() NOT NULL,
modified timestamp with time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.files OWNER TO dak;
--
-- Name: location_id_seq; Type: SEQUENCE; Schema: public; Owner: dak
--
CREATE SEQUENCE location_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.location_id_seq OWNER TO dak;
--
-- Name: location; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE location (
id integer DEFAULT nextval('location_id_seq'::regclass) NOT NULL,
path text NOT NULL,
component integer,
archive integer,
type text NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL,
modified timestamp with time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.location OWNER TO dak;
--
-- Name: binfiles_suite_component_arch; Type: VIEW; Schema: public; Owner: dak
--
CREATE VIEW binfiles_suite_component_arch AS
SELECT files.filename, binaries.type, location.path, location.component, bin_associations.suite, binaries.architecture FROM (((binaries JOIN bin_associations ON ((binaries.id = bin_associations.bin))) JOIN files ON ((binaries.file = files.id))) JOIN location ON ((files.location = location.id)));
ALTER TABLE public.binfiles_suite_component_arch OWNER TO dak;
--
-- Name: build_queue; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE build_queue (
id integer NOT NULL,
queue_name text NOT NULL,
path text NOT NULL,
copy_files boolean DEFAULT false NOT NULL,
generate_metadata boolean DEFAULT false NOT NULL,
origin text,
label text,
releasedescription text,
signingkey text,
stay_of_execution integer DEFAULT 86400 NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL,
modified timestamp with time zone DEFAULT now() NOT NULL,
notautomatic boolean DEFAULT false NOT NULL,
CONSTRAINT build_queue_meta_sanity_check CHECK (((generate_metadata IS FALSE) OR (((origin IS NOT NULL) AND (label IS NOT NULL)) AND (releasedescription IS NOT NULL)))),
CONSTRAINT build_queue_stay_of_execution_check CHECK ((stay_of_execution >= 0))
);
ALTER TABLE public.build_queue OWNER TO dak;
--
-- Name: build_queue_files; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE build_queue_files (
id integer NOT NULL,
build_queue_id integer NOT NULL,
insertdate timestamp without time zone DEFAULT now() NOT NULL,
lastused timestamp without time zone,
filename text NOT NULL,
fileid integer,
created timestamp with time zone DEFAULT now() NOT NULL,
modified timestamp with time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.build_queue_files OWNER TO dak;
--
-- Name: build_queue_files_id_seq; Type: SEQUENCE; Schema: public; Owner: dak
--
CREATE SEQUENCE build_queue_files_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.build_queue_files_id_seq OWNER TO dak;
--
-- Name: build_queue_files_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dak
--
ALTER SEQUENCE build_queue_files_id_seq OWNED BY build_queue_files.id;
--
-- Name: build_queue_id_seq; Type: SEQUENCE; Schema: public; Owner: dak
--
CREATE SEQUENCE build_queue_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.build_queue_id_seq OWNER TO dak;
--
-- Name: build_queue_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dak
--
ALTER SEQUENCE build_queue_id_seq OWNED BY build_queue.id;
--
-- Name: build_queue_policy_files; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE build_queue_policy_files (
build_queue_id integer NOT NULL,
file_id integer NOT NULL,
filename text NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL,
lastused timestamp without time zone
);
ALTER TABLE public.build_queue_policy_files OWNER TO dak;
--
-- Name: changelogs_text; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE changelogs_text (
id integer NOT NULL,
changelog text
);
ALTER TABLE public.changelogs_text OWNER TO dak;
--
-- Name: changes; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE changes (
id integer NOT NULL,
changesname text NOT NULL,
seen timestamp with time zone DEFAULT now() NOT NULL,
source text NOT NULL,
binaries text NOT NULL,
architecture text NOT NULL,
version text NOT NULL,
distribution text NOT NULL,
urgency text NOT NULL,
maintainer text NOT NULL,
fingerprint text NOT NULL,
changedby text NOT NULL,
date text NOT NULL,
in_queue integer,
approved_for integer,
created timestamp with time zone DEFAULT now() NOT NULL,
modified timestamp with time zone DEFAULT now() NOT NULL,
changelog_id integer
);
ALTER TABLE public.changes OWNER TO dak;
--
-- Name: changelogs; Type: VIEW; Schema: public; Owner: dak
--
CREATE VIEW changelogs AS
SELECT cl.id, c.source, (c.version)::debversion AS version, c.architecture, cl.changelog, c.distribution FROM (changes c JOIN changelogs_text cl ON ((cl.id = c.changelog_id)));
ALTER TABLE public.changelogs OWNER TO dak;
--
-- Name: changelogs_text_id_seq; Type: SEQUENCE; Schema: public; Owner: dak
--
CREATE SEQUENCE changelogs_text_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.changelogs_text_id_seq OWNER TO dak;
--
-- Name: changelogs_text_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dak
--
ALTER SEQUENCE changelogs_text_id_seq OWNED BY changelogs_text.id;
--
-- Name: changes_id_seq; Type: SEQUENCE; Schema: public; Owner: dak
--
CREATE SEQUENCE changes_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.changes_id_seq OWNER TO dak;
--
-- Name: changes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dak
--
ALTER SEQUENCE changes_id_seq OWNED BY changes.id;
--
-- Name: changes_pending_binaries; Type: TABLE; Schema: public; Owner: dak; Tablespace:
--
CREATE TABLE changes_pending_binaries (
id integer NOT NULL,