]> git.ipfire.org Git - pbs.git/blob - src/database.sql
df20b5bcf48ff77ef739a0e245efbbe935025d6b
[pbs.git] / src / database.sql
1 --
2 -- PostgreSQL database dump
3 --
4
5 -- Dumped from database version 15.10 (Debian 15.10-0+deb12u1)
6 -- Dumped by pg_dump version 15.10 (Debian 15.10-0+deb12u1)
7
8 SET statement_timeout = 0;
9 SET lock_timeout = 0;
10 SET idle_in_transaction_session_timeout = 0;
11 SET client_encoding = 'UTF8';
12 SET standard_conforming_strings = on;
13 SELECT pg_catalog.set_config('search_path', '', false);
14 SET check_function_bodies = false;
15 SET xmloption = content;
16 SET client_min_messages = warning;
17 SET row_security = off;
18
19 --
20 -- Name: public; Type: SCHEMA; Schema: -; Owner: -
21 --
22
23 -- *not* creating schema, since initdb creates it
24
25
26 SET default_tablespace = '';
27
28 SET default_table_access_method = heap;
29
30 --
31 -- Name: build_bugs; Type: TABLE; Schema: public; Owner: -
32 --
33
34 CREATE TABLE public.build_bugs (
35 id integer NOT NULL,
36 build_id integer NOT NULL,
37 bug_id integer NOT NULL,
38 added_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
39 added_by_id integer,
40 removed_at timestamp without time zone,
41 removed_by_id integer
42 );
43
44
45 --
46 -- Name: build_bugs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
47 --
48
49 CREATE SEQUENCE public.build_bugs_id_seq
50 AS integer
51 START WITH 1
52 INCREMENT BY 1
53 NO MINVALUE
54 NO MAXVALUE
55 CACHE 1;
56
57
58 --
59 -- Name: build_bugs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
60 --
61
62 ALTER SEQUENCE public.build_bugs_id_seq OWNED BY public.build_bugs.id;
63
64
65 --
66 -- Name: build_comments; Type: TABLE; Schema: public; Owner: -
67 --
68
69 CREATE TABLE public.build_comments (
70 id integer NOT NULL,
71 build_id integer NOT NULL,
72 user_id integer NOT NULL,
73 text text DEFAULT ''::text NOT NULL,
74 created_at timestamp without time zone DEFAULT now() NOT NULL,
75 deleted_at timestamp without time zone
76 );
77
78
79 --
80 -- Name: build_groups; Type: TABLE; Schema: public; Owner: -
81 --
82
83 CREATE TABLE public.build_groups (
84 id integer NOT NULL,
85 uuid uuid DEFAULT gen_random_uuid() NOT NULL,
86 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
87 created_by_id integer,
88 deleted_at timestamp without time zone,
89 deleted_by_id integer,
90 finished_at timestamp without time zone,
91 failed boolean DEFAULT false NOT NULL,
92 tested_build_id integer
93 );
94
95
96 --
97 -- Name: build_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: -
98 --
99
100 CREATE SEQUENCE public.build_groups_id_seq
101 AS integer
102 START WITH 1
103 INCREMENT BY 1
104 NO MINVALUE
105 NO MAXVALUE
106 CACHE 1;
107
108
109 --
110 -- Name: build_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
111 --
112
113 ALTER SEQUENCE public.build_groups_id_seq OWNED BY public.build_groups.id;
114
115
116 --
117 -- Name: build_packages; Type: TABLE; Schema: public; Owner: -
118 --
119
120 CREATE TABLE public.build_packages (
121 build_id integer NOT NULL,
122 package_id integer NOT NULL,
123 job_id integer NOT NULL,
124 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
125 );
126
127
128 --
129 -- Name: build_points; Type: TABLE; Schema: public; Owner: -
130 --
131
132 CREATE TABLE public.build_points (
133 build_id integer NOT NULL,
134 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
135 points integer DEFAULT 0 NOT NULL,
136 user_id integer
137 );
138
139
140 --
141 -- Name: build_watchers; Type: TABLE; Schema: public; Owner: -
142 --
143
144 CREATE TABLE public.build_watchers (
145 build_id integer NOT NULL,
146 user_id integer NOT NULL,
147 added_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
148 deleted_at timestamp without time zone
149 );
150
151
152 --
153 -- Name: builder_stats; Type: TABLE; Schema: public; Owner: -
154 --
155
156 CREATE TABLE public.builder_stats (
157 builder_id integer NOT NULL,
158 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
159 cpu_user double precision NOT NULL,
160 cpu_nice double precision NOT NULL,
161 cpu_system double precision NOT NULL,
162 cpu_idle double precision NOT NULL,
163 cpu_iowait double precision NOT NULL,
164 cpu_irq double precision NOT NULL,
165 cpu_softirq double precision NOT NULL,
166 cpu_steal double precision NOT NULL,
167 cpu_guest double precision NOT NULL,
168 cpu_guest_nice double precision NOT NULL,
169 loadavg1 double precision NOT NULL,
170 loadavg5 double precision NOT NULL,
171 loadavg15 double precision NOT NULL,
172 mem_total bigint NOT NULL,
173 mem_available bigint NOT NULL,
174 mem_used bigint NOT NULL,
175 mem_free bigint NOT NULL,
176 mem_active bigint NOT NULL,
177 mem_inactive bigint NOT NULL,
178 mem_buffers bigint NOT NULL,
179 mem_cached bigint NOT NULL,
180 mem_shared bigint NOT NULL,
181 swap_total bigint NOT NULL,
182 swap_used bigint NOT NULL,
183 swap_free bigint NOT NULL
184 );
185
186
187 --
188 -- Name: builders; Type: TABLE; Schema: public; Owner: -
189 --
190
191 CREATE TABLE public.builders (
192 id integer NOT NULL,
193 name text NOT NULL,
194 description text,
195 enabled boolean DEFAULT false NOT NULL,
196 loadavg text DEFAULT '0'::character varying NOT NULL,
197 maintenance boolean DEFAULT false NOT NULL,
198 max_jobs bigint DEFAULT (1)::bigint NOT NULL,
199 version text,
200 os_name text,
201 cpu_model text,
202 cpu_count integer DEFAULT 1 NOT NULL,
203 host_key_id text,
204 arch text,
205 instance_id text,
206 instance_type text,
207 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
208 created_by_id integer NOT NULL,
209 deleted_at timestamp without time zone,
210 deleted_by_id integer,
211 sys_vendor text,
212 sys_name text,
213 connected_at timestamp without time zone,
214 connected_from inet
215 );
216
217
218 --
219 -- Name: builders_id_seq; Type: SEQUENCE; Schema: public; Owner: -
220 --
221
222 CREATE SEQUENCE public.builders_id_seq
223 START WITH 1
224 INCREMENT BY 1
225 NO MINVALUE
226 NO MAXVALUE
227 CACHE 1;
228
229
230 --
231 -- Name: builders_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
232 --
233
234 ALTER SEQUENCE public.builders_id_seq OWNED BY public.builders.id;
235
236
237 --
238 -- Name: builds; Type: TABLE; Schema: public; Owner: -
239 --
240
241 CREATE TABLE public.builds (
242 id integer NOT NULL,
243 uuid uuid DEFAULT gen_random_uuid() NOT NULL,
244 pkg_id integer NOT NULL,
245 severity text,
246 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
247 repo_id integer NOT NULL,
248 owner_id integer,
249 priority integer DEFAULT 0 NOT NULL,
250 finished_at timestamp without time zone,
251 failed boolean DEFAULT false NOT NULL,
252 deleted_at timestamp without time zone,
253 deleted_by_id integer,
254 group_id integer,
255 deprecating_build_id integer,
256 deprecated_at timestamp without time zone,
257 deprecated_by_id integer,
258 test boolean DEFAULT false NOT NULL,
259 disable_test_builds boolean DEFAULT false NOT NULL,
260 points integer DEFAULT 0 NOT NULL,
261 commit_id integer
262 );
263
264
265 --
266 -- Name: builds_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
267 --
268
269 CREATE SEQUENCE public.builds_comments_id_seq
270 START WITH 1
271 INCREMENT BY 1
272 NO MINVALUE
273 NO MAXVALUE
274 CACHE 1;
275
276
277 --
278 -- Name: builds_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
279 --
280
281 ALTER SEQUENCE public.builds_comments_id_seq OWNED BY public.build_comments.id;
282
283
284 --
285 -- Name: builds_id_seq; Type: SEQUENCE; Schema: public; Owner: -
286 --
287
288 CREATE SEQUENCE public.builds_id_seq
289 START WITH 1
290 INCREMENT BY 1
291 NO MINVALUE
292 NO MAXVALUE
293 CACHE 1;
294
295
296 --
297 -- Name: builds_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
298 --
299
300 ALTER SEQUENCE public.builds_id_seq OWNED BY public.builds.id;
301
302
303 --
304 -- Name: cache; Type: TABLE; Schema: public; Owner: -
305 --
306
307 CREATE TABLE public.cache (
308 key text NOT NULL,
309 value bytea NOT NULL,
310 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
311 expires_at timestamp without time zone
312 );
313
314
315 --
316 -- Name: distributions; Type: TABLE; Schema: public; Owner: -
317 --
318
319 CREATE TABLE public.distributions (
320 id integer NOT NULL,
321 name text NOT NULL,
322 distro_id text NOT NULL,
323 slogan text DEFAULT ''::text NOT NULL,
324 description text DEFAULT ''::text NOT NULL,
325 vendor text DEFAULT ''::text NOT NULL,
326 contact text DEFAULT ''::text NOT NULL,
327 version_id integer NOT NULL,
328 deleted boolean DEFAULT false NOT NULL,
329 arches text[] DEFAULT ARRAY[]::text[] NOT NULL,
330 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
331 custom_config text DEFAULT ''::text NOT NULL,
332 codename text DEFAULT ''::text NOT NULL,
333 bugzilla_product text DEFAULT ''::text NOT NULL,
334 bugzilla_version text DEFAULT ''::text NOT NULL,
335 deleted_at timestamp without time zone,
336 tag text GENERATED ALWAYS AS ((distro_id || version_id)) STORED
337 );
338
339
340 --
341 -- Name: distributions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
342 --
343
344 CREATE SEQUENCE public.distributions_id_seq
345 START WITH 1
346 INCREMENT BY 1
347 NO MINVALUE
348 NO MAXVALUE
349 CACHE 1;
350
351
352 --
353 -- Name: distributions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
354 --
355
356 ALTER SEQUENCE public.distributions_id_seq OWNED BY public.distributions.id;
357
358
359 --
360 -- Name: images; Type: TABLE; Schema: public; Owner: -
361 --
362
363 CREATE TABLE public.images (
364 id integer NOT NULL,
365 release_id integer NOT NULL,
366 type text NOT NULL,
367 arch text NOT NULL,
368 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
369 created_by_id integer,
370 deleted_at timestamp without time zone,
371 deleted_by_id integer,
372 path text NOT NULL,
373 size bigint NOT NULL,
374 checksum_sha3_512 bytea NOT NULL,
375 checksum_sha3_256 bytea NOT NULL,
376 checksum_blake2b512 bytea NOT NULL,
377 checksum_blake2s256 bytea NOT NULL,
378 checksum_sha2_512 bytea NOT NULL,
379 checksum_sha2_256 bytea NOT NULL
380 );
381
382
383 --
384 -- Name: images_id_seq; Type: SEQUENCE; Schema: public; Owner: -
385 --
386
387 CREATE SEQUENCE public.images_id_seq
388 AS integer
389 START WITH 1
390 INCREMENT BY 1
391 NO MINVALUE
392 NO MAXVALUE
393 CACHE 1;
394
395
396 --
397 -- Name: images_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
398 --
399
400 ALTER SEQUENCE public.images_id_seq OWNED BY public.images.id;
401
402
403 --
404 -- Name: images_types; Type: TABLE; Schema: public; Owner: -
405 --
406
407 CREATE TABLE public.images_types (
408 id integer NOT NULL,
409 type text NOT NULL
410 );
411
412
413 --
414 -- Name: images_types_id_seq; Type: SEQUENCE; Schema: public; Owner: -
415 --
416
417 CREATE SEQUENCE public.images_types_id_seq
418 START WITH 1
419 INCREMENT BY 1
420 NO MINVALUE
421 NO MAXVALUE
422 CACHE 1;
423
424
425 --
426 -- Name: images_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
427 --
428
429 ALTER SEQUENCE public.images_types_id_seq OWNED BY public.images_types.id;
430
431
432 --
433 -- Name: job_packages; Type: TABLE; Schema: public; Owner: -
434 --
435
436 CREATE TABLE public.job_packages (
437 job_id integer NOT NULL,
438 pkg_id integer NOT NULL
439 );
440
441
442 --
443 -- Name: jobs; Type: TABLE; Schema: public; Owner: -
444 --
445
446 CREATE TABLE public.jobs (
447 id integer NOT NULL,
448 uuid uuid DEFAULT gen_random_uuid() NOT NULL,
449 build_id integer NOT NULL,
450 arch text NOT NULL,
451 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
452 started_at timestamp without time zone,
453 finished_at timestamp without time zone,
454 builder_id integer,
455 message text,
456 superseeded_by_id integer,
457 installcheck_succeeded boolean,
458 installcheck_performed_at timestamp without time zone,
459 failed boolean DEFAULT false NOT NULL,
460 log_path text,
461 log_size bigint,
462 log_digest_blake2s bytea,
463 deleted_at timestamp without time zone,
464 deleted_by integer,
465 aborted boolean DEFAULT false NOT NULL,
466 aborted_by_id integer,
467 timeout interval
468 );
469
470
471 --
472 -- Name: jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
473 --
474
475 CREATE SEQUENCE public.jobs_id_seq
476 START WITH 1
477 INCREMENT BY 1
478 NO MINVALUE
479 NO MAXVALUE
480 CACHE 1;
481
482
483 --
484 -- Name: jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
485 --
486
487 ALTER SEQUENCE public.jobs_id_seq OWNED BY public.jobs.id;
488
489
490 --
491 -- Name: keys; Type: TABLE; Schema: public; Owner: -
492 --
493
494 CREATE TABLE public.keys (
495 id integer NOT NULL,
496 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
497 created_by_id integer,
498 deleted_at timestamp without time zone,
499 deleted_by_id integer,
500 public_key text NOT NULL,
501 secret_key text NOT NULL,
502 key_id numeric NOT NULL,
503 comment text
504 );
505
506
507 --
508 -- Name: keys_id_seq; Type: SEQUENCE; Schema: public; Owner: -
509 --
510
511 CREATE SEQUENCE public.keys_id_seq
512 AS integer
513 START WITH 1
514 INCREMENT BY 1
515 NO MINVALUE
516 NO MAXVALUE
517 CACHE 1;
518
519
520 --
521 -- Name: keys_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
522 --
523
524 ALTER SEQUENCE public.keys_id_seq OWNED BY public.keys.id;
525
526
527 --
528 -- Name: messages; Type: TABLE; Schema: public; Owner: -
529 --
530
531 CREATE TABLE public.messages (
532 id integer NOT NULL,
533 message text NOT NULL,
534 queued_at timestamp without time zone DEFAULT now() NOT NULL,
535 sent_at timestamp without time zone,
536 priority integer DEFAULT 0 NOT NULL,
537 error_message text
538 );
539
540
541 --
542 -- Name: messages_id_seq; Type: SEQUENCE; Schema: public; Owner: -
543 --
544
545 CREATE SEQUENCE public.messages_id_seq
546 START WITH 1
547 INCREMENT BY 1
548 NO MINVALUE
549 NO MAXVALUE
550 CACHE 1;
551
552
553 --
554 -- Name: messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
555 --
556
557 ALTER SEQUENCE public.messages_id_seq OWNED BY public.messages.id;
558
559
560 --
561 -- Name: mirror_checks; Type: TABLE; Schema: public; Owner: -
562 --
563
564 CREATE TABLE public.mirror_checks (
565 mirror_id integer NOT NULL,
566 checked_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
567 success boolean DEFAULT false NOT NULL,
568 response_time double precision,
569 http_status integer,
570 last_sync_at timestamp without time zone,
571 error text
572 );
573
574
575 --
576 -- Name: mirrors; Type: TABLE; Schema: public; Owner: -
577 --
578
579 CREATE TABLE public.mirrors (
580 id integer NOT NULL,
581 hostname text NOT NULL,
582 path text NOT NULL,
583 owner text,
584 contact text,
585 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
586 created_by_id integer NOT NULL,
587 deleted_at timestamp without time zone,
588 deleted_by_id integer,
589 last_check_success boolean,
590 last_check_at timestamp without time zone,
591 last_sync_at timestamp without time zone,
592 country_code text,
593 error text,
594 asn integer,
595 notes text DEFAULT ''::text NOT NULL,
596 addresses_ipv6 inet[] DEFAULT '{}'::inet[] NOT NULL,
597 addresses_ipv4 inet[] DEFAULT '{}'::inet[] NOT NULL
598 );
599
600
601 --
602 -- Name: mirrors_id_seq; Type: SEQUENCE; Schema: public; Owner: -
603 --
604
605 CREATE SEQUENCE public.mirrors_id_seq
606 START WITH 1
607 INCREMENT BY 1
608 NO MINVALUE
609 NO MAXVALUE
610 CACHE 1;
611
612
613 --
614 -- Name: mirrors_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
615 --
616
617 ALTER SEQUENCE public.mirrors_id_seq OWNED BY public.mirrors.id;
618
619
620 --
621 -- Name: package_files; Type: TABLE; Schema: public; Owner: -
622 --
623
624 CREATE TABLE public.package_files (
625 pkg_id integer NOT NULL,
626 path text NOT NULL,
627 size bigint NOT NULL,
628 config boolean DEFAULT false NOT NULL,
629 mode integer NOT NULL,
630 uname text NOT NULL,
631 gname text NOT NULL,
632 ctime timestamp without time zone NOT NULL,
633 mtime timestamp without time zone NOT NULL,
634 digest_sha2_512 bytea,
635 digest_sha2_256 bytea,
636 digest_blake2b512 bytea,
637 digest_blake2s256 bytea,
638 digest_sha3_512 bytea,
639 digest_sha3_256 bytea,
640 mimetype text,
641 capabilities text
642 );
643
644
645 --
646 -- Name: packages; Type: TABLE; Schema: public; Owner: -
647 --
648
649 CREATE TABLE public.packages (
650 id integer NOT NULL,
651 name text NOT NULL,
652 evr text NOT NULL,
653 arch text NOT NULL,
654 groups text[] NOT NULL,
655 packager text,
656 license text NOT NULL,
657 url text NOT NULL,
658 summary text NOT NULL,
659 description text NOT NULL,
660 size numeric NOT NULL,
661 build_arches text[],
662 uuid uuid NOT NULL,
663 commit_id integer,
664 build_id uuid,
665 build_host text NOT NULL,
666 build_time timestamp without time zone NOT NULL,
667 path text,
668 filesize numeric NOT NULL,
669 prerequires text[] DEFAULT ARRAY[]::text[] NOT NULL,
670 requires text[] DEFAULT ARRAY[]::text[] NOT NULL,
671 provides text[] DEFAULT ARRAY[]::text[] NOT NULL,
672 obsoletes text[] DEFAULT ARRAY[]::text[] NOT NULL,
673 conflicts text[] DEFAULT ARRAY[]::text[] NOT NULL,
674 recommends text[] DEFAULT ARRAY[]::text[] NOT NULL,
675 suggests text[] DEFAULT ARRAY[]::text[] NOT NULL,
676 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
677 digest_type text NOT NULL,
678 digest bytea NOT NULL,
679 deleted_at timestamp without time zone,
680 deleted_by integer,
681 distro_id integer NOT NULL,
682 search tsvector GENERATED ALWAYS AS (((setweight(to_tsvector('simple'::regconfig, name), 'A'::"char") || setweight(to_tsvector('english'::regconfig, summary), 'B'::"char")) || setweight(to_tsvector('english'::regconfig, description), 'C'::"char"))) STORED
683 );
684
685
686 --
687 -- Name: packages_id_seq; Type: SEQUENCE; Schema: public; Owner: -
688 --
689
690 CREATE SEQUENCE public.packages_id_seq
691 START WITH 1
692 INCREMENT BY 1
693 NO MINVALUE
694 NO MAXVALUE
695 CACHE 1;
696
697
698 --
699 -- Name: packages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
700 --
701
702 ALTER SEQUENCE public.packages_id_seq OWNED BY public.packages.id;
703
704
705 --
706 -- Name: ratelimiter; Type: TABLE; Schema: public; Owner: -
707 --
708
709 CREATE UNLOGGED TABLE public.ratelimiter (
710 key text NOT NULL,
711 "timestamp" timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
712 address inet NOT NULL,
713 requests integer DEFAULT 1 NOT NULL,
714 expires_at timestamp without time zone NOT NULL
715 );
716
717
718 --
719 -- Name: relation_sizes; Type: VIEW; Schema: public; Owner: -
720 --
721
722 CREATE VIEW public.relation_sizes AS
723 SELECT c.relname AS relation,
724 pg_size_pretty(pg_relation_size((c.oid)::regclass)) AS size
725 FROM (pg_class c
726 LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace)))
727 WHERE (n.nspname <> ALL (ARRAY['pg_catalog'::name, 'information_schema'::name]))
728 ORDER BY (pg_relation_size((c.oid)::regclass)) DESC;
729
730
731 --
732 -- Name: release_images; Type: TABLE; Schema: public; Owner: -
733 --
734
735 CREATE TABLE public.release_images (
736 id integer NOT NULL,
737 release_id integer NOT NULL,
738 type_id integer NOT NULL,
739 arch text NOT NULL,
740 filename text NOT NULL,
741 path text
742 );
743
744
745 --
746 -- Name: release_images_id_seq; Type: SEQUENCE; Schema: public; Owner: -
747 --
748
749 CREATE SEQUENCE public.release_images_id_seq
750 AS integer
751 START WITH 1
752 INCREMENT BY 1
753 NO MINVALUE
754 NO MAXVALUE
755 CACHE 1;
756
757
758 --
759 -- Name: release_images_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
760 --
761
762 ALTER SEQUENCE public.release_images_id_seq OWNED BY public.release_images.id;
763
764
765 --
766 -- Name: release_monitoring_releases; Type: TABLE; Schema: public; Owner: -
767 --
768
769 CREATE TABLE public.release_monitoring_releases (
770 id integer NOT NULL,
771 monitoring_id integer NOT NULL,
772 version text NOT NULL,
773 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
774 bug_id integer,
775 build_id integer,
776 diff text,
777 repo_id integer,
778 log text
779 );
780
781
782 --
783 -- Name: release_monitoring_releases_id_seq; Type: SEQUENCE; Schema: public; Owner: -
784 --
785
786 CREATE SEQUENCE public.release_monitoring_releases_id_seq
787 AS integer
788 START WITH 1
789 INCREMENT BY 1
790 NO MINVALUE
791 NO MAXVALUE
792 CACHE 1;
793
794
795 --
796 -- Name: release_monitoring_releases_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
797 --
798
799 ALTER SEQUENCE public.release_monitoring_releases_id_seq OWNED BY public.release_monitoring_releases.id;
800
801
802 --
803 -- Name: release_monitorings; Type: TABLE; Schema: public; Owner: -
804 --
805
806 CREATE TABLE public.release_monitorings (
807 id integer NOT NULL,
808 distro_id integer NOT NULL,
809 name text NOT NULL,
810 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
811 created_by_id integer NOT NULL,
812 deleted_at timestamp without time zone,
813 deleted_by_id integer,
814 project_id integer NOT NULL,
815 follow text NOT NULL,
816 last_check_at timestamp without time zone,
817 create_builds boolean DEFAULT true NOT NULL
818 );
819
820
821 --
822 -- Name: release_monitorings_id_seq; Type: SEQUENCE; Schema: public; Owner: -
823 --
824
825 CREATE SEQUENCE public.release_monitorings_id_seq
826 AS integer
827 START WITH 1
828 INCREMENT BY 1
829 NO MINVALUE
830 NO MAXVALUE
831 CACHE 1;
832
833
834 --
835 -- Name: release_monitorings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
836 --
837
838 ALTER SEQUENCE public.release_monitorings_id_seq OWNED BY public.release_monitorings.id;
839
840
841 --
842 -- Name: releases; Type: TABLE; Schema: public; Owner: -
843 --
844
845 CREATE TABLE public.releases (
846 id integer NOT NULL,
847 distro_id integer NOT NULL,
848 name text NOT NULL,
849 slug text NOT NULL,
850 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
851 created_by_id integer NOT NULL,
852 deleted_at timestamp without time zone,
853 deleted_by_id integer,
854 published_at timestamp without time zone,
855 stable boolean DEFAULT false NOT NULL,
856 announcement text
857 );
858
859
860 --
861 -- Name: releases_id_seq; Type: SEQUENCE; Schema: public; Owner: -
862 --
863
864 CREATE SEQUENCE public.releases_id_seq
865 AS integer
866 START WITH 1
867 INCREMENT BY 1
868 NO MINVALUE
869 NO MAXVALUE
870 CACHE 1;
871
872
873 --
874 -- Name: releases_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
875 --
876
877 ALTER SEQUENCE public.releases_id_seq OWNED BY public.releases.id;
878
879
880 --
881 -- Name: repositories; Type: TABLE; Schema: public; Owner: -
882 --
883
884 CREATE TABLE public.repositories (
885 id integer NOT NULL,
886 name text NOT NULL,
887 slug text NOT NULL,
888 description text DEFAULT ''::text NOT NULL,
889 distro_id integer NOT NULL,
890 key_id integer NOT NULL,
891 mirrored boolean DEFAULT false NOT NULL,
892 updated_at timestamp without time zone,
893 deleted_at timestamp without time zone,
894 priority integer,
895 owner_id integer,
896 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
897 listed boolean DEFAULT true NOT NULL,
898 deleted_by integer
899 );
900
901
902 --
903 -- Name: repositories_id_seq; Type: SEQUENCE; Schema: public; Owner: -
904 --
905
906 CREATE SEQUENCE public.repositories_id_seq
907 START WITH 1
908 INCREMENT BY 1
909 NO MINVALUE
910 NO MAXVALUE
911 CACHE 1;
912
913
914 --
915 -- Name: repositories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
916 --
917
918 ALTER SEQUENCE public.repositories_id_seq OWNED BY public.repositories.id;
919
920
921 --
922 -- Name: repository_builds; Type: TABLE; Schema: public; Owner: -
923 --
924
925 CREATE TABLE public.repository_builds (
926 id integer NOT NULL,
927 repo_id integer NOT NULL,
928 build_id bigint NOT NULL,
929 added_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
930 added_by_id integer,
931 removed_at timestamp without time zone,
932 removed_by_id integer
933 );
934
935
936 --
937 -- Name: repository_builds_id_seq; Type: SEQUENCE; Schema: public; Owner: -
938 --
939
940 CREATE SEQUENCE public.repository_builds_id_seq
941 START WITH 1
942 INCREMENT BY 1
943 NO MINVALUE
944 NO MAXVALUE
945 CACHE 1;
946
947
948 --
949 -- Name: repository_builds_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
950 --
951
952 ALTER SEQUENCE public.repository_builds_id_seq OWNED BY public.repository_builds.id;
953
954
955 --
956 -- Name: sessions; Type: TABLE; Schema: public; Owner: -
957 --
958
959 CREATE TABLE public.sessions (
960 id integer NOT NULL,
961 session_id text DEFAULT gen_random_uuid() NOT NULL,
962 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
963 expires_at timestamp without time zone NOT NULL,
964 user_id integer NOT NULL,
965 address inet,
966 user_agent text
967 );
968
969
970 --
971 -- Name: sessions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
972 --
973
974 CREATE SEQUENCE public.sessions_id_seq
975 START WITH 1
976 INCREMENT BY 1
977 NO MINVALUE
978 NO MAXVALUE
979 CACHE 1;
980
981
982 --
983 -- Name: sessions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
984 --
985
986 ALTER SEQUENCE public.sessions_id_seq OWNED BY public.sessions.id;
987
988
989 --
990 -- Name: source_commit_jobs; Type: TABLE; Schema: public; Owner: -
991 --
992
993 CREATE TABLE public.source_commit_jobs (
994 id integer NOT NULL,
995 commit_id integer NOT NULL,
996 action text NOT NULL,
997 name text NOT NULL,
998 finished_at timestamp without time zone,
999 success boolean,
1000 error text,
1001 log text
1002 );
1003
1004
1005 --
1006 -- Name: source_commit_jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1007 --
1008
1009 CREATE SEQUENCE public.source_commit_jobs_id_seq
1010 AS integer
1011 START WITH 1
1012 INCREMENT BY 1
1013 NO MINVALUE
1014 NO MAXVALUE
1015 CACHE 1;
1016
1017
1018 --
1019 -- Name: source_commit_jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1020 --
1021
1022 ALTER SEQUENCE public.source_commit_jobs_id_seq OWNED BY public.source_commit_jobs.id;
1023
1024
1025 --
1026 -- Name: source_commits; Type: TABLE; Schema: public; Owner: -
1027 --
1028
1029 CREATE TABLE public.source_commits (
1030 id integer NOT NULL,
1031 source_id integer NOT NULL,
1032 revision text NOT NULL,
1033 author text NOT NULL,
1034 committer text NOT NULL,
1035 subject text NOT NULL,
1036 body text NOT NULL,
1037 date timestamp without time zone NOT NULL,
1038 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
1039 deleted_at timestamp without time zone,
1040 build_group_id integer,
1041 finished_at timestamp without time zone
1042 );
1043
1044
1045 --
1046 -- Name: source_commits_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1047 --
1048
1049 CREATE SEQUENCE public.source_commits_id_seq
1050 START WITH 1
1051 INCREMENT BY 1
1052 NO MINVALUE
1053 NO MAXVALUE
1054 CACHE 1;
1055
1056
1057 --
1058 -- Name: source_commits_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1059 --
1060
1061 ALTER SEQUENCE public.source_commits_id_seq OWNED BY public.source_commits.id;
1062
1063
1064 --
1065 -- Name: sources; Type: TABLE; Schema: public; Owner: -
1066 --
1067
1068 CREATE TABLE public.sources (
1069 id integer NOT NULL,
1070 name text NOT NULL,
1071 slug text NOT NULL,
1072 url text NOT NULL,
1073 gitweb text,
1074 revision text,
1075 branch text NOT NULL,
1076 last_fetched_at timestamp without time zone,
1077 repo_id integer NOT NULL,
1078 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
1079 created_by_id integer NOT NULL,
1080 deleted_at timestamp without time zone,
1081 deleted_by_id integer
1082 );
1083
1084
1085 --
1086 -- Name: sources_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1087 --
1088
1089 CREATE SEQUENCE public.sources_id_seq
1090 START WITH 1
1091 INCREMENT BY 1
1092 NO MINVALUE
1093 NO MAXVALUE
1094 CACHE 1;
1095
1096
1097 --
1098 -- Name: sources_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1099 --
1100
1101 ALTER SEQUENCE public.sources_id_seq OWNED BY public.sources.id;
1102
1103
1104 --
1105 -- Name: uploads; Type: TABLE; Schema: public; Owner: -
1106 --
1107
1108 CREATE TABLE public.uploads (
1109 id integer NOT NULL,
1110 uuid uuid DEFAULT gen_random_uuid() NOT NULL,
1111 user_id integer,
1112 builder_id integer,
1113 filename text NOT NULL,
1114 path text,
1115 size bigint NOT NULL,
1116 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
1117 expires_at timestamp without time zone DEFAULT (CURRENT_TIMESTAMP + '24:00:00'::interval) NOT NULL,
1118 digest_blake2b512 bytea NOT NULL
1119 );
1120
1121
1122 --
1123 -- Name: uploads_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1124 --
1125
1126 CREATE SEQUENCE public.uploads_id_seq
1127 START WITH 1
1128 INCREMENT BY 1
1129 NO MINVALUE
1130 NO MAXVALUE
1131 CACHE 1;
1132
1133
1134 --
1135 -- Name: uploads_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1136 --
1137
1138 ALTER SEQUENCE public.uploads_id_seq OWNED BY public.uploads.id;
1139
1140
1141 --
1142 -- Name: user_push_subscriptions; Type: TABLE; Schema: public; Owner: -
1143 --
1144
1145 CREATE TABLE public.user_push_subscriptions (
1146 id integer NOT NULL,
1147 user_id integer NOT NULL,
1148 uuid uuid DEFAULT gen_random_uuid() NOT NULL,
1149 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
1150 deleted_at timestamp without time zone,
1151 user_agent text,
1152 endpoint text NOT NULL,
1153 p256dh bytea NOT NULL,
1154 auth bytea NOT NULL
1155 );
1156
1157
1158 --
1159 -- Name: user_push_subscriptions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1160 --
1161
1162 CREATE SEQUENCE public.user_push_subscriptions_id_seq
1163 AS integer
1164 START WITH 1
1165 INCREMENT BY 1
1166 NO MINVALUE
1167 NO MAXVALUE
1168 CACHE 1;
1169
1170
1171 --
1172 -- Name: user_push_subscriptions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1173 --
1174
1175 ALTER SEQUENCE public.user_push_subscriptions_id_seq OWNED BY public.user_push_subscriptions.id;
1176
1177
1178 --
1179 -- Name: users; Type: TABLE; Schema: public; Owner: -
1180 --
1181
1182 CREATE TABLE public.users (
1183 id integer NOT NULL,
1184 name text NOT NULL,
1185 deleted_at timestamp without time zone,
1186 registered_at timestamp without time zone DEFAULT now() NOT NULL,
1187 admin boolean DEFAULT false NOT NULL,
1188 storage_quota bigint,
1189 perms text[] DEFAULT ARRAY[]::text[] NOT NULL,
1190 _attrs bytea,
1191 bugzilla_api_key text,
1192 daily_build_quota interval
1193 );
1194
1195
1196 --
1197 -- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1198 --
1199
1200 CREATE SEQUENCE public.users_id_seq
1201 START WITH 1
1202 INCREMENT BY 1
1203 NO MINVALUE
1204 NO MAXVALUE
1205 CACHE 1;
1206
1207
1208 --
1209 -- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1210 --
1211
1212 ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
1213
1214
1215 --
1216 -- Name: build_bugs id; Type: DEFAULT; Schema: public; Owner: -
1217 --
1218
1219 ALTER TABLE ONLY public.build_bugs ALTER COLUMN id SET DEFAULT nextval('public.build_bugs_id_seq'::regclass);
1220
1221
1222 --
1223 -- Name: build_comments id; Type: DEFAULT; Schema: public; Owner: -
1224 --
1225
1226 ALTER TABLE ONLY public.build_comments ALTER COLUMN id SET DEFAULT nextval('public.builds_comments_id_seq'::regclass);
1227
1228
1229 --
1230 -- Name: build_groups id; Type: DEFAULT; Schema: public; Owner: -
1231 --
1232
1233 ALTER TABLE ONLY public.build_groups ALTER COLUMN id SET DEFAULT nextval('public.build_groups_id_seq'::regclass);
1234
1235
1236 --
1237 -- Name: builders id; Type: DEFAULT; Schema: public; Owner: -
1238 --
1239
1240 ALTER TABLE ONLY public.builders ALTER COLUMN id SET DEFAULT nextval('public.builders_id_seq'::regclass);
1241
1242
1243 --
1244 -- Name: builds id; Type: DEFAULT; Schema: public; Owner: -
1245 --
1246
1247 ALTER TABLE ONLY public.builds ALTER COLUMN id SET DEFAULT nextval('public.builds_id_seq'::regclass);
1248
1249
1250 --
1251 -- Name: distributions id; Type: DEFAULT; Schema: public; Owner: -
1252 --
1253
1254 ALTER TABLE ONLY public.distributions ALTER COLUMN id SET DEFAULT nextval('public.distributions_id_seq'::regclass);
1255
1256
1257 --
1258 -- Name: images id; Type: DEFAULT; Schema: public; Owner: -
1259 --
1260
1261 ALTER TABLE ONLY public.images ALTER COLUMN id SET DEFAULT nextval('public.images_id_seq'::regclass);
1262
1263
1264 --
1265 -- Name: images_types id; Type: DEFAULT; Schema: public; Owner: -
1266 --
1267
1268 ALTER TABLE ONLY public.images_types ALTER COLUMN id SET DEFAULT nextval('public.images_types_id_seq'::regclass);
1269
1270
1271 --
1272 -- Name: jobs id; Type: DEFAULT; Schema: public; Owner: -
1273 --
1274
1275 ALTER TABLE ONLY public.jobs ALTER COLUMN id SET DEFAULT nextval('public.jobs_id_seq'::regclass);
1276
1277
1278 --
1279 -- Name: keys id; Type: DEFAULT; Schema: public; Owner: -
1280 --
1281
1282 ALTER TABLE ONLY public.keys ALTER COLUMN id SET DEFAULT nextval('public.keys_id_seq'::regclass);
1283
1284
1285 --
1286 -- Name: messages id; Type: DEFAULT; Schema: public; Owner: -
1287 --
1288
1289 ALTER TABLE ONLY public.messages ALTER COLUMN id SET DEFAULT nextval('public.messages_id_seq'::regclass);
1290
1291
1292 --
1293 -- Name: mirrors id; Type: DEFAULT; Schema: public; Owner: -
1294 --
1295
1296 ALTER TABLE ONLY public.mirrors ALTER COLUMN id SET DEFAULT nextval('public.mirrors_id_seq'::regclass);
1297
1298
1299 --
1300 -- Name: packages id; Type: DEFAULT; Schema: public; Owner: -
1301 --
1302
1303 ALTER TABLE ONLY public.packages ALTER COLUMN id SET DEFAULT nextval('public.packages_id_seq'::regclass);
1304
1305
1306 --
1307 -- Name: release_images id; Type: DEFAULT; Schema: public; Owner: -
1308 --
1309
1310 ALTER TABLE ONLY public.release_images ALTER COLUMN id SET DEFAULT nextval('public.release_images_id_seq'::regclass);
1311
1312
1313 --
1314 -- Name: release_monitoring_releases id; Type: DEFAULT; Schema: public; Owner: -
1315 --
1316
1317 ALTER TABLE ONLY public.release_monitoring_releases ALTER COLUMN id SET DEFAULT nextval('public.release_monitoring_releases_id_seq'::regclass);
1318
1319
1320 --
1321 -- Name: release_monitorings id; Type: DEFAULT; Schema: public; Owner: -
1322 --
1323
1324 ALTER TABLE ONLY public.release_monitorings ALTER COLUMN id SET DEFAULT nextval('public.release_monitorings_id_seq'::regclass);
1325
1326
1327 --
1328 -- Name: releases id; Type: DEFAULT; Schema: public; Owner: -
1329 --
1330
1331 ALTER TABLE ONLY public.releases ALTER COLUMN id SET DEFAULT nextval('public.releases_id_seq'::regclass);
1332
1333
1334 --
1335 -- Name: repositories id; Type: DEFAULT; Schema: public; Owner: -
1336 --
1337
1338 ALTER TABLE ONLY public.repositories ALTER COLUMN id SET DEFAULT nextval('public.repositories_id_seq'::regclass);
1339
1340
1341 --
1342 -- Name: repository_builds id; Type: DEFAULT; Schema: public; Owner: -
1343 --
1344
1345 ALTER TABLE ONLY public.repository_builds ALTER COLUMN id SET DEFAULT nextval('public.repository_builds_id_seq'::regclass);
1346
1347
1348 --
1349 -- Name: sessions id; Type: DEFAULT; Schema: public; Owner: -
1350 --
1351
1352 ALTER TABLE ONLY public.sessions ALTER COLUMN id SET DEFAULT nextval('public.sessions_id_seq'::regclass);
1353
1354
1355 --
1356 -- Name: source_commit_jobs id; Type: DEFAULT; Schema: public; Owner: -
1357 --
1358
1359 ALTER TABLE ONLY public.source_commit_jobs ALTER COLUMN id SET DEFAULT nextval('public.source_commit_jobs_id_seq'::regclass);
1360
1361
1362 --
1363 -- Name: source_commits id; Type: DEFAULT; Schema: public; Owner: -
1364 --
1365
1366 ALTER TABLE ONLY public.source_commits ALTER COLUMN id SET DEFAULT nextval('public.source_commits_id_seq'::regclass);
1367
1368
1369 --
1370 -- Name: sources id; Type: DEFAULT; Schema: public; Owner: -
1371 --
1372
1373 ALTER TABLE ONLY public.sources ALTER COLUMN id SET DEFAULT nextval('public.sources_id_seq'::regclass);
1374
1375
1376 --
1377 -- Name: uploads id; Type: DEFAULT; Schema: public; Owner: -
1378 --
1379
1380 ALTER TABLE ONLY public.uploads ALTER COLUMN id SET DEFAULT nextval('public.uploads_id_seq'::regclass);
1381
1382
1383 --
1384 -- Name: user_push_subscriptions id; Type: DEFAULT; Schema: public; Owner: -
1385 --
1386
1387 ALTER TABLE ONLY public.user_push_subscriptions ALTER COLUMN id SET DEFAULT nextval('public.user_push_subscriptions_id_seq'::regclass);
1388
1389
1390 --
1391 -- Name: users id; Type: DEFAULT; Schema: public; Owner: -
1392 --
1393
1394 ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
1395
1396
1397 --
1398 -- Name: build_bugs build_bugs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1399 --
1400
1401 ALTER TABLE ONLY public.build_bugs
1402 ADD CONSTRAINT build_bugs_pkey PRIMARY KEY (id);
1403
1404
1405 --
1406 -- Name: build_comments build_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1407 --
1408
1409 ALTER TABLE ONLY public.build_comments
1410 ADD CONSTRAINT build_comments_pkey PRIMARY KEY (id);
1411
1412
1413 --
1414 -- Name: build_groups build_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1415 --
1416
1417 ALTER TABLE ONLY public.build_groups
1418 ADD CONSTRAINT build_groups_pkey PRIMARY KEY (id);
1419
1420
1421 --
1422 -- Name: builds builds_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1423 --
1424
1425 ALTER TABLE ONLY public.builds
1426 ADD CONSTRAINT builds_pkey PRIMARY KEY (id);
1427
1428
1429 --
1430 -- Name: cache cache_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1431 --
1432
1433 ALTER TABLE ONLY public.cache
1434 ADD CONSTRAINT cache_pkey PRIMARY KEY (key);
1435
1436
1437 --
1438 -- Name: distributions distributions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1439 --
1440
1441 ALTER TABLE ONLY public.distributions
1442 ADD CONSTRAINT distributions_pkey PRIMARY KEY (id);
1443
1444
1445 --
1446 -- Name: builders idx_2197954_primary; Type: CONSTRAINT; Schema: public; Owner: -
1447 --
1448
1449 ALTER TABLE ONLY public.builders
1450 ADD CONSTRAINT idx_2197954_primary PRIMARY KEY (id);
1451
1452
1453 --
1454 -- Name: images_types image_types_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1455 --
1456
1457 ALTER TABLE ONLY public.images_types
1458 ADD CONSTRAINT image_types_pkey PRIMARY KEY (id);
1459
1460
1461 --
1462 -- Name: images images_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1463 --
1464
1465 ALTER TABLE ONLY public.images
1466 ADD CONSTRAINT images_pkey PRIMARY KEY (id);
1467
1468
1469 --
1470 -- Name: images images_unique; Type: CONSTRAINT; Schema: public; Owner: -
1471 --
1472
1473 ALTER TABLE ONLY public.images
1474 ADD CONSTRAINT images_unique UNIQUE (release_id, type, arch);
1475
1476
1477 --
1478 -- Name: jobs jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1479 --
1480
1481 ALTER TABLE ONLY public.jobs
1482 ADD CONSTRAINT jobs_pkey PRIMARY KEY (id);
1483
1484
1485 --
1486 -- Name: keys keys_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1487 --
1488
1489 ALTER TABLE ONLY public.keys
1490 ADD CONSTRAINT keys_pkey PRIMARY KEY (id);
1491
1492
1493 --
1494 -- Name: messages messages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1495 --
1496
1497 ALTER TABLE ONLY public.messages
1498 ADD CONSTRAINT messages_pkey PRIMARY KEY (id);
1499
1500
1501 --
1502 -- Name: mirrors mirrors_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1503 --
1504
1505 ALTER TABLE ONLY public.mirrors
1506 ADD CONSTRAINT mirrors_pkey PRIMARY KEY (id);
1507
1508
1509 --
1510 -- Name: packages packages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1511 --
1512
1513 ALTER TABLE ONLY public.packages
1514 ADD CONSTRAINT packages_pkey PRIMARY KEY (id);
1515
1516
1517 --
1518 -- Name: ratelimiter ratelimiter_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1519 --
1520
1521 ALTER TABLE ONLY public.ratelimiter
1522 ADD CONSTRAINT ratelimiter_pkey PRIMARY KEY (key, "timestamp", address);
1523
1524
1525 --
1526 -- Name: ratelimiter ratelimiter_unique; Type: CONSTRAINT; Schema: public; Owner: -
1527 --
1528
1529 ALTER TABLE ONLY public.ratelimiter
1530 ADD CONSTRAINT ratelimiter_unique UNIQUE (key, "timestamp", address);
1531
1532
1533 --
1534 -- Name: release_images release_images_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1535 --
1536
1537 ALTER TABLE ONLY public.release_images
1538 ADD CONSTRAINT release_images_pkey PRIMARY KEY (id);
1539
1540
1541 --
1542 -- Name: release_monitoring_releases release_monitoring_releases_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1543 --
1544
1545 ALTER TABLE ONLY public.release_monitoring_releases
1546 ADD CONSTRAINT release_monitoring_releases_pkey PRIMARY KEY (id);
1547
1548
1549 --
1550 -- Name: release_monitorings release_monitorings_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1551 --
1552
1553 ALTER TABLE ONLY public.release_monitorings
1554 ADD CONSTRAINT release_monitorings_pkey PRIMARY KEY (id);
1555
1556
1557 --
1558 -- Name: releases releases_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1559 --
1560
1561 ALTER TABLE ONLY public.releases
1562 ADD CONSTRAINT releases_pkey PRIMARY KEY (id);
1563
1564
1565 --
1566 -- Name: repositories repositories_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1567 --
1568
1569 ALTER TABLE ONLY public.repositories
1570 ADD CONSTRAINT repositories_pkey PRIMARY KEY (id);
1571
1572
1573 --
1574 -- Name: repository_builds repository_builds_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1575 --
1576
1577 ALTER TABLE ONLY public.repository_builds
1578 ADD CONSTRAINT repository_builds_pkey PRIMARY KEY (id);
1579
1580
1581 --
1582 -- Name: sessions sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1583 --
1584
1585 ALTER TABLE ONLY public.sessions
1586 ADD CONSTRAINT sessions_pkey PRIMARY KEY (id);
1587
1588
1589 --
1590 -- Name: sessions sessions_session_id_key; Type: CONSTRAINT; Schema: public; Owner: -
1591 --
1592
1593 ALTER TABLE ONLY public.sessions
1594 ADD CONSTRAINT sessions_session_id_key UNIQUE (session_id);
1595
1596
1597 --
1598 -- Name: source_commit_jobs source_commit_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1599 --
1600
1601 ALTER TABLE ONLY public.source_commit_jobs
1602 ADD CONSTRAINT source_commit_jobs_pkey PRIMARY KEY (id);
1603
1604
1605 --
1606 -- Name: source_commits source_commits_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1607 --
1608
1609 ALTER TABLE ONLY public.source_commits
1610 ADD CONSTRAINT source_commits_pkey PRIMARY KEY (id);
1611
1612
1613 --
1614 -- Name: sources sources_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1615 --
1616
1617 ALTER TABLE ONLY public.sources
1618 ADD CONSTRAINT sources_pkey PRIMARY KEY (id);
1619
1620
1621 --
1622 -- Name: uploads uploads_id; Type: CONSTRAINT; Schema: public; Owner: -
1623 --
1624
1625 ALTER TABLE ONLY public.uploads
1626 ADD CONSTRAINT uploads_id PRIMARY KEY (id);
1627
1628
1629 --
1630 -- Name: user_push_subscriptions user_push_subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1631 --
1632
1633 ALTER TABLE ONLY public.user_push_subscriptions
1634 ADD CONSTRAINT user_push_subscriptions_pkey PRIMARY KEY (id);
1635
1636
1637 --
1638 -- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1639 --
1640
1641 ALTER TABLE ONLY public.users
1642 ADD CONSTRAINT users_pkey PRIMARY KEY (id);
1643
1644
1645 --
1646 -- Name: build_bugs_unique; Type: INDEX; Schema: public; Owner: -
1647 --
1648
1649 CREATE UNIQUE INDEX build_bugs_unique ON public.build_bugs USING btree (build_id, bug_id) WHERE (removed_at IS NULL);
1650
1651
1652 --
1653 -- Name: build_groups_uuid; Type: INDEX; Schema: public; Owner: -
1654 --
1655
1656 CREATE UNIQUE INDEX build_groups_uuid ON public.build_groups USING btree (uuid) WHERE (deleted_at IS NULL);
1657
1658
1659 --
1660 -- Name: build_packages_build_id; Type: INDEX; Schema: public; Owner: -
1661 --
1662
1663 CREATE INDEX build_packages_build_id ON public.build_packages USING btree (build_id);
1664
1665
1666 --
1667 -- Name: build_points_build_id; Type: INDEX; Schema: public; Owner: -
1668 --
1669
1670 CREATE INDEX build_points_build_id ON public.build_points USING btree (build_id);
1671
1672
1673 --
1674 -- Name: build_watchers_unique; Type: INDEX; Schema: public; Owner: -
1675 --
1676
1677 CREATE UNIQUE INDEX build_watchers_unique ON public.build_watchers USING btree (build_id, user_id) WHERE (deleted_at IS NULL);
1678
1679
1680 --
1681 -- Name: builders_name; Type: INDEX; Schema: public; Owner: -
1682 --
1683
1684 CREATE UNIQUE INDEX builders_name ON public.builders USING btree (name) WHERE (deleted_at IS NULL);
1685
1686
1687 --
1688 -- Name: builds_build_group_id; Type: INDEX; Schema: public; Owner: -
1689 --
1690
1691 CREATE INDEX builds_build_group_id ON public.builds USING btree (group_id) WHERE (deleted_at IS NULL);
1692
1693
1694 --
1695 -- Name: builds_created_at; Type: INDEX; Schema: public; Owner: -
1696 --
1697
1698 CREATE INDEX builds_created_at ON public.builds USING btree (created_at DESC) WHERE (deleted_at IS NULL);
1699
1700
1701 --
1702 -- Name: builds_deleted; Type: INDEX; Schema: public; Owner: -
1703 --
1704
1705 CREATE INDEX builds_deleted ON public.builds USING btree (deleted_at) WHERE (deleted_at IS NOT NULL);
1706
1707
1708 --
1709 -- Name: builds_deprecating_build_id; Type: INDEX; Schema: public; Owner: -
1710 --
1711
1712 CREATE INDEX builds_deprecating_build_id ON public.builds USING btree (deprecating_build_id) WHERE ((deleted_at IS NULL) AND (deprecated_at IS NOT NULL));
1713
1714
1715 --
1716 -- Name: builds_not_tests; Type: INDEX; Schema: public; Owner: -
1717 --
1718
1719 CREATE UNIQUE INDEX builds_not_tests ON public.builds USING btree (id) WHERE ((test IS FALSE) AND (deleted_at IS NULL));
1720
1721
1722 --
1723 -- Name: builds_pkg_id; Type: INDEX; Schema: public; Owner: -
1724 --
1725
1726 CREATE INDEX builds_pkg_id ON public.builds USING btree (pkg_id) WHERE (deleted_at IS NULL);
1727
1728
1729 --
1730 -- Name: builds_scratch_builds; Type: INDEX; Schema: public; Owner: -
1731 --
1732
1733 CREATE UNIQUE INDEX builds_scratch_builds ON public.builds USING btree (id) WHERE ((deleted_at IS NULL) AND (test IS FALSE) AND (owner_id IS NOT NULL));
1734
1735
1736 --
1737 -- Name: builds_uuid; Type: INDEX; Schema: public; Owner: -
1738 --
1739
1740 CREATE UNIQUE INDEX builds_uuid ON public.builds USING btree (uuid) WHERE (deleted_at IS NULL);
1741
1742
1743 --
1744 -- Name: distributions_tag; Type: INDEX; Schema: public; Owner: -
1745 --
1746
1747 CREATE UNIQUE INDEX distributions_tag ON public.distributions USING btree (tag) WHERE (deleted_at IS NULL);
1748
1749
1750 --
1751 -- Name: distributions_unique; Type: INDEX; Schema: public; Owner: -
1752 --
1753
1754 CREATE UNIQUE INDEX distributions_unique ON public.distributions USING btree (distro_id, version_id) WHERE (deleted IS FALSE);
1755
1756
1757 --
1758 -- Name: job_packages_job_id; Type: INDEX; Schema: public; Owner: -
1759 --
1760
1761 CREATE INDEX job_packages_job_id ON public.job_packages USING btree (job_id);
1762
1763
1764 --
1765 -- Name: job_packages_pkg_id; Type: INDEX; Schema: public; Owner: -
1766 --
1767
1768 CREATE UNIQUE INDEX job_packages_pkg_id ON public.job_packages USING btree (pkg_id);
1769
1770
1771 --
1772 -- Name: jobs_arch; Type: INDEX; Schema: public; Owner: -
1773 --
1774
1775 CREATE INDEX jobs_arch ON public.jobs USING btree (arch);
1776
1777
1778 --
1779 -- Name: jobs_build_id; Type: INDEX; Schema: public; Owner: -
1780 --
1781
1782 CREATE INDEX jobs_build_id ON public.jobs USING btree (build_id) WHERE (deleted_at IS NULL);
1783
1784
1785 --
1786 -- Name: jobs_finished_at; Type: INDEX; Schema: public; Owner: -
1787 --
1788
1789 CREATE INDEX jobs_finished_at ON public.jobs USING btree (finished_at DESC) WHERE (finished_at IS NOT NULL);
1790
1791
1792 --
1793 -- Name: jobs_pending; Type: INDEX; Schema: public; Owner: -
1794 --
1795
1796 CREATE INDEX jobs_pending ON public.jobs USING btree (id) WHERE ((deleted_at IS NULL) AND (started_at IS NULL) AND (finished_at IS NULL) AND (installcheck_succeeded IS TRUE));
1797
1798
1799 --
1800 -- Name: jobs_running; Type: INDEX; Schema: public; Owner: -
1801 --
1802
1803 CREATE INDEX jobs_running ON public.jobs USING btree (started_at) WHERE ((deleted_at IS NULL) AND (started_at IS NOT NULL) AND (finished_at IS NULL));
1804
1805
1806 --
1807 -- Name: jobs_superseeded_by; Type: INDEX; Schema: public; Owner: -
1808 --
1809
1810 CREATE INDEX jobs_superseeded_by ON public.jobs USING btree (superseeded_by_id);
1811
1812
1813 --
1814 -- Name: jobs_uuid; Type: INDEX; Schema: public; Owner: -
1815 --
1816
1817 CREATE UNIQUE INDEX jobs_uuid ON public.jobs USING btree (uuid) WHERE (deleted_at IS NULL);
1818
1819
1820 --
1821 -- Name: messages_queued; Type: INDEX; Schema: public; Owner: -
1822 --
1823
1824 CREATE INDEX messages_queued ON public.messages USING btree (priority DESC, queued_at) WHERE (sent_at IS NULL);
1825
1826
1827 --
1828 -- Name: mirror_checks_search; Type: INDEX; Schema: public; Owner: -
1829 --
1830
1831 CREATE INDEX mirror_checks_search ON public.mirror_checks USING btree (mirror_id, checked_at);
1832
1833
1834 --
1835 -- Name: mirrors_hostname; Type: INDEX; Schema: public; Owner: -
1836 --
1837
1838 CREATE UNIQUE INDEX mirrors_hostname ON public.mirrors USING btree (hostname) WHERE (deleted_at IS NULL);
1839
1840
1841 --
1842 -- Name: package_files_path; Type: INDEX; Schema: public; Owner: -
1843 --
1844
1845 CREATE INDEX package_files_path ON public.package_files USING btree (path);
1846
1847
1848 --
1849 -- Name: package_files_pkg_id; Type: INDEX; Schema: public; Owner: -
1850 --
1851
1852 CREATE INDEX package_files_pkg_id ON public.package_files USING btree (pkg_id);
1853
1854
1855 --
1856 -- Name: packages_name; Type: INDEX; Schema: public; Owner: -
1857 --
1858
1859 CREATE INDEX packages_name ON public.packages USING btree (name);
1860
1861
1862 --
1863 -- Name: packages_search; Type: INDEX; Schema: public; Owner: -
1864 --
1865
1866 CREATE INDEX packages_search ON public.packages USING gin (search) WHERE (deleted_at IS NULL);
1867
1868
1869 --
1870 -- Name: release_monitoring_releases_build_id; Type: INDEX; Schema: public; Owner: -
1871 --
1872
1873 CREATE INDEX release_monitoring_releases_build_id ON public.release_monitoring_releases USING btree (build_id);
1874
1875
1876 --
1877 -- Name: release_monitoring_releases_search; Type: INDEX; Schema: public; Owner: -
1878 --
1879
1880 CREATE INDEX release_monitoring_releases_search ON public.release_monitoring_releases USING btree (monitoring_id, created_at);
1881
1882
1883 --
1884 -- Name: release_monitoring_releases_unique; Type: INDEX; Schema: public; Owner: -
1885 --
1886
1887 CREATE UNIQUE INDEX release_monitoring_releases_unique ON public.release_monitoring_releases USING btree (monitoring_id, version);
1888
1889
1890 --
1891 -- Name: release_monitorings_unique; Type: INDEX; Schema: public; Owner: -
1892 --
1893
1894 CREATE UNIQUE INDEX release_monitorings_unique ON public.release_monitorings USING btree (distro_id, name) WHERE (deleted_at IS NULL);
1895
1896
1897 --
1898 -- Name: releases_distro_id; Type: INDEX; Schema: public; Owner: -
1899 --
1900
1901 CREATE INDEX releases_distro_id ON public.releases USING btree (distro_id) WHERE (deleted_at IS NULL);
1902
1903
1904 --
1905 -- Name: releases_unique; Type: INDEX; Schema: public; Owner: -
1906 --
1907
1908 CREATE UNIQUE INDEX releases_unique ON public.releases USING btree (slug) WHERE (deleted_at IS NULL);
1909
1910
1911 --
1912 -- Name: repositories_unique; Type: INDEX; Schema: public; Owner: -
1913 --
1914
1915 CREATE UNIQUE INDEX repositories_unique ON public.repositories USING btree (owner_id, distro_id, slug) WHERE (deleted_at IS NULL);
1916
1917
1918 --
1919 -- Name: repository_builds_build_id; Type: INDEX; Schema: public; Owner: -
1920 --
1921
1922 CREATE INDEX repository_builds_build_id ON public.repository_builds USING btree (build_id);
1923
1924
1925 --
1926 -- Name: repository_builds_repo_id; Type: INDEX; Schema: public; Owner: -
1927 --
1928
1929 CREATE INDEX repository_builds_repo_id ON public.repository_builds USING btree (repo_id) WHERE (removed_at IS NULL);
1930
1931
1932 --
1933 -- Name: repository_builds_unique; Type: INDEX; Schema: public; Owner: -
1934 --
1935
1936 CREATE UNIQUE INDEX repository_builds_unique ON public.repository_builds USING btree (repo_id, build_id) WHERE (removed_at IS NULL);
1937
1938
1939 --
1940 -- Name: source_commit_jobs_commit_id; Type: INDEX; Schema: public; Owner: -
1941 --
1942
1943 CREATE INDEX source_commit_jobs_commit_id ON public.source_commit_jobs USING btree (commit_id);
1944
1945
1946 --
1947 -- Name: source_commits_unique; Type: INDEX; Schema: public; Owner: -
1948 --
1949
1950 CREATE UNIQUE INDEX source_commits_unique ON public.source_commits USING btree (source_id, revision);
1951
1952
1953 --
1954 -- Name: sources_repo_id; Type: INDEX; Schema: public; Owner: -
1955 --
1956
1957 CREATE INDEX sources_repo_id ON public.sources USING btree (repo_id) WHERE (deleted_at IS NULL);
1958
1959
1960 --
1961 -- Name: sources_slug; Type: INDEX; Schema: public; Owner: -
1962 --
1963
1964 CREATE UNIQUE INDEX sources_slug ON public.sources USING btree (slug) WHERE (deleted_at IS NULL);
1965
1966
1967 --
1968 -- Name: uploads_builder_id; Type: INDEX; Schema: public; Owner: -
1969 --
1970
1971 CREATE INDEX uploads_builder_id ON public.uploads USING btree (builder_id);
1972
1973
1974 --
1975 -- Name: uploads_user_id; Type: INDEX; Schema: public; Owner: -
1976 --
1977
1978 CREATE INDEX uploads_user_id ON public.uploads USING btree (user_id);
1979
1980
1981 --
1982 -- Name: uploads_uuid; Type: INDEX; Schema: public; Owner: -
1983 --
1984
1985 CREATE UNIQUE INDEX uploads_uuid ON public.uploads USING btree (uuid);
1986
1987
1988 --
1989 -- Name: user_push_subscriptions_user_id; Type: INDEX; Schema: public; Owner: -
1990 --
1991
1992 CREATE INDEX user_push_subscriptions_user_id ON public.user_push_subscriptions USING btree (user_id) WHERE (deleted_at IS NULL);
1993
1994
1995 --
1996 -- Name: users_name; Type: INDEX; Schema: public; Owner: -
1997 --
1998
1999 CREATE UNIQUE INDEX users_name ON public.users USING btree (name) WHERE (deleted_at IS NULL);
2000
2001
2002 --
2003 -- Name: build_bugs build_bugs_added_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2004 --
2005
2006 ALTER TABLE ONLY public.build_bugs
2007 ADD CONSTRAINT build_bugs_added_by FOREIGN KEY (added_by_id) REFERENCES public.users(id);
2008
2009
2010 --
2011 -- Name: build_bugs build_bugs_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2012 --
2013
2014 ALTER TABLE ONLY public.build_bugs
2015 ADD CONSTRAINT build_bugs_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
2016
2017
2018 --
2019 -- Name: build_bugs build_bugs_removed_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2020 --
2021
2022 ALTER TABLE ONLY public.build_bugs
2023 ADD CONSTRAINT build_bugs_removed_by FOREIGN KEY (removed_by_id) REFERENCES public.users(id);
2024
2025
2026 --
2027 -- Name: build_groups build_groups_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2028 --
2029
2030 ALTER TABLE ONLY public.build_groups
2031 ADD CONSTRAINT build_groups_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
2032
2033
2034 --
2035 -- Name: build_groups build_groups_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2036 --
2037
2038 ALTER TABLE ONLY public.build_groups
2039 ADD CONSTRAINT build_groups_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
2040
2041
2042 --
2043 -- Name: build_groups build_groups_tested_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2044 --
2045
2046 ALTER TABLE ONLY public.build_groups
2047 ADD CONSTRAINT build_groups_tested_build_id FOREIGN KEY (tested_build_id) REFERENCES public.builds(id);
2048
2049
2050 --
2051 -- Name: build_packages build_packages_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2052 --
2053
2054 ALTER TABLE ONLY public.build_packages
2055 ADD CONSTRAINT build_packages_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
2056
2057
2058 --
2059 -- Name: build_packages build_packages_job_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2060 --
2061
2062 ALTER TABLE ONLY public.build_packages
2063 ADD CONSTRAINT build_packages_job_id FOREIGN KEY (job_id) REFERENCES public.jobs(id);
2064
2065
2066 --
2067 -- Name: build_packages build_packages_package_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2068 --
2069
2070 ALTER TABLE ONLY public.build_packages
2071 ADD CONSTRAINT build_packages_package_id FOREIGN KEY (package_id) REFERENCES public.packages(id);
2072
2073
2074 --
2075 -- Name: build_points build_points_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2076 --
2077
2078 ALTER TABLE ONLY public.build_points
2079 ADD CONSTRAINT build_points_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
2080
2081
2082 --
2083 -- Name: build_points build_points_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2084 --
2085
2086 ALTER TABLE ONLY public.build_points
2087 ADD CONSTRAINT build_points_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
2088
2089
2090 --
2091 -- Name: build_watchers build_watchers_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2092 --
2093
2094 ALTER TABLE ONLY public.build_watchers
2095 ADD CONSTRAINT build_watchers_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
2096
2097
2098 --
2099 -- Name: build_watchers build_watchers_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2100 --
2101
2102 ALTER TABLE ONLY public.build_watchers
2103 ADD CONSTRAINT build_watchers_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
2104
2105
2106 --
2107 -- Name: builder_stats builder_stats_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2108 --
2109
2110 ALTER TABLE ONLY public.builder_stats
2111 ADD CONSTRAINT builder_stats_builder_id FOREIGN KEY (builder_id) REFERENCES public.builders(id);
2112
2113
2114 --
2115 -- Name: builders builders_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2116 --
2117
2118 ALTER TABLE ONLY public.builders
2119 ADD CONSTRAINT builders_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
2120
2121
2122 --
2123 -- Name: builders builders_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2124 --
2125
2126 ALTER TABLE ONLY public.builders
2127 ADD CONSTRAINT builders_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
2128
2129
2130 --
2131 -- Name: build_comments builds_comments_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2132 --
2133
2134 ALTER TABLE ONLY public.build_comments
2135 ADD CONSTRAINT builds_comments_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
2136
2137
2138 --
2139 -- Name: build_comments builds_comments_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2140 --
2141
2142 ALTER TABLE ONLY public.build_comments
2143 ADD CONSTRAINT builds_comments_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
2144
2145
2146 --
2147 -- Name: builds builds_commit_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2148 --
2149
2150 ALTER TABLE ONLY public.builds
2151 ADD CONSTRAINT builds_commit_id FOREIGN KEY (commit_id) REFERENCES public.source_commits(id) NOT VALID;
2152
2153
2154 --
2155 -- Name: builds builds_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2156 --
2157
2158 ALTER TABLE ONLY public.builds
2159 ADD CONSTRAINT builds_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
2160
2161
2162 --
2163 -- Name: builds builds_deprecated_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2164 --
2165
2166 ALTER TABLE ONLY public.builds
2167 ADD CONSTRAINT builds_deprecated_by FOREIGN KEY (deprecated_by_id) REFERENCES public.users(id);
2168
2169
2170 --
2171 -- Name: builds builds_deprecating_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2172 --
2173
2174 ALTER TABLE ONLY public.builds
2175 ADD CONSTRAINT builds_deprecating_build_id FOREIGN KEY (deprecating_build_id) REFERENCES public.builds(id);
2176
2177
2178 --
2179 -- Name: builds builds_group_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2180 --
2181
2182 ALTER TABLE ONLY public.builds
2183 ADD CONSTRAINT builds_group_id FOREIGN KEY (group_id) REFERENCES public.build_groups(id);
2184
2185
2186 --
2187 -- Name: builds builds_owner_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2188 --
2189
2190 ALTER TABLE ONLY public.builds
2191 ADD CONSTRAINT builds_owner_id FOREIGN KEY (owner_id) REFERENCES public.users(id);
2192
2193
2194 --
2195 -- Name: builds builds_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2196 --
2197
2198 ALTER TABLE ONLY public.builds
2199 ADD CONSTRAINT builds_pkg_id FOREIGN KEY (pkg_id) REFERENCES public.packages(id);
2200
2201
2202 --
2203 -- Name: builds builds_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2204 --
2205
2206 ALTER TABLE ONLY public.builds
2207 ADD CONSTRAINT builds_repo_id FOREIGN KEY (repo_id) REFERENCES public.repositories(id);
2208
2209
2210 --
2211 -- Name: images images_created_by_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2212 --
2213
2214 ALTER TABLE ONLY public.images
2215 ADD CONSTRAINT images_created_by_id FOREIGN KEY (created_by_id) REFERENCES public.users(id);
2216
2217
2218 --
2219 -- Name: images images_deleted_by_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2220 --
2221
2222 ALTER TABLE ONLY public.images
2223 ADD CONSTRAINT images_deleted_by_id FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
2224
2225
2226 --
2227 -- Name: images images_release_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2228 --
2229
2230 ALTER TABLE ONLY public.images
2231 ADD CONSTRAINT images_release_id FOREIGN KEY (release_id) REFERENCES public.releases(id);
2232
2233
2234 --
2235 -- Name: job_packages job_packages_job_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2236 --
2237
2238 ALTER TABLE ONLY public.job_packages
2239 ADD CONSTRAINT job_packages_job_id FOREIGN KEY (job_id) REFERENCES public.jobs(id);
2240
2241
2242 --
2243 -- Name: job_packages job_packages_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2244 --
2245
2246 ALTER TABLE ONLY public.job_packages
2247 ADD CONSTRAINT job_packages_pkg_id FOREIGN KEY (pkg_id) REFERENCES public.packages(id);
2248
2249
2250 --
2251 -- Name: jobs jobs_aborted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2252 --
2253
2254 ALTER TABLE ONLY public.jobs
2255 ADD CONSTRAINT jobs_aborted_by FOREIGN KEY (aborted_by_id) REFERENCES public.users(id);
2256
2257
2258 --
2259 -- Name: jobs jobs_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2260 --
2261
2262 ALTER TABLE ONLY public.jobs
2263 ADD CONSTRAINT jobs_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
2264
2265
2266 --
2267 -- Name: jobs jobs_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2268 --
2269
2270 ALTER TABLE ONLY public.jobs
2271 ADD CONSTRAINT jobs_builder_id FOREIGN KEY (builder_id) REFERENCES public.builders(id);
2272
2273
2274 --
2275 -- Name: jobs jobs_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2276 --
2277
2278 ALTER TABLE ONLY public.jobs
2279 ADD CONSTRAINT jobs_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
2280
2281
2282 --
2283 -- Name: jobs jobs_superseeded_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2284 --
2285
2286 ALTER TABLE ONLY public.jobs
2287 ADD CONSTRAINT jobs_superseeded_by FOREIGN KEY (superseeded_by_id) REFERENCES public.jobs(id);
2288
2289
2290 --
2291 -- Name: keys keys_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2292 --
2293
2294 ALTER TABLE ONLY public.keys
2295 ADD CONSTRAINT keys_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
2296
2297
2298 --
2299 -- Name: keys keys_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2300 --
2301
2302 ALTER TABLE ONLY public.keys
2303 ADD CONSTRAINT keys_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
2304
2305
2306 --
2307 -- Name: mirror_checks mirror_checks_mirror_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2308 --
2309
2310 ALTER TABLE ONLY public.mirror_checks
2311 ADD CONSTRAINT mirror_checks_mirror_id FOREIGN KEY (mirror_id) REFERENCES public.mirrors(id);
2312
2313
2314 --
2315 -- Name: mirrors mirrors_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2316 --
2317
2318 ALTER TABLE ONLY public.mirrors
2319 ADD CONSTRAINT mirrors_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
2320
2321
2322 --
2323 -- Name: mirrors mirrors_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2324 --
2325
2326 ALTER TABLE ONLY public.mirrors
2327 ADD CONSTRAINT mirrors_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
2328
2329
2330 --
2331 -- Name: package_files package_files_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2332 --
2333
2334 ALTER TABLE ONLY public.package_files
2335 ADD CONSTRAINT package_files_pkg_id FOREIGN KEY (pkg_id) REFERENCES public.packages(id);
2336
2337
2338 --
2339 -- Name: packages packages_commit_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2340 --
2341
2342 ALTER TABLE ONLY public.packages
2343 ADD CONSTRAINT packages_commit_id FOREIGN KEY (commit_id) REFERENCES public.source_commits(id);
2344
2345
2346 --
2347 -- Name: packages packages_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2348 --
2349
2350 ALTER TABLE ONLY public.packages
2351 ADD CONSTRAINT packages_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
2352
2353
2354 --
2355 -- Name: packages packages_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2356 --
2357
2358 ALTER TABLE ONLY public.packages
2359 ADD CONSTRAINT packages_distro_id FOREIGN KEY (distro_id) REFERENCES public.distributions(id);
2360
2361
2362 --
2363 -- Name: release_images release_images_release_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2364 --
2365
2366 ALTER TABLE ONLY public.release_images
2367 ADD CONSTRAINT release_images_release_id FOREIGN KEY (release_id) REFERENCES public.releases(id);
2368
2369
2370 --
2371 -- Name: release_images release_images_type_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2372 --
2373
2374 ALTER TABLE ONLY public.release_images
2375 ADD CONSTRAINT release_images_type_id FOREIGN KEY (type_id) REFERENCES public.images_types(id);
2376
2377
2378 --
2379 -- Name: release_monitoring_releases release_monitoring_releases_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2380 --
2381
2382 ALTER TABLE ONLY public.release_monitoring_releases
2383 ADD CONSTRAINT release_monitoring_releases_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
2384
2385
2386 --
2387 -- Name: release_monitoring_releases release_monitoring_releases_monitoring_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2388 --
2389
2390 ALTER TABLE ONLY public.release_monitoring_releases
2391 ADD CONSTRAINT release_monitoring_releases_monitoring_id FOREIGN KEY (monitoring_id) REFERENCES public.release_monitorings(id);
2392
2393
2394 --
2395 -- Name: release_monitoring_releases release_monitoring_releases_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2396 --
2397
2398 ALTER TABLE ONLY public.release_monitoring_releases
2399 ADD CONSTRAINT release_monitoring_releases_repo_id FOREIGN KEY (repo_id) REFERENCES public.repositories(id);
2400
2401
2402 --
2403 -- Name: release_monitorings release_monitorings_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2404 --
2405
2406 ALTER TABLE ONLY public.release_monitorings
2407 ADD CONSTRAINT release_monitorings_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
2408
2409
2410 --
2411 -- Name: release_monitorings release_monitorings_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2412 --
2413
2414 ALTER TABLE ONLY public.release_monitorings
2415 ADD CONSTRAINT release_monitorings_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
2416
2417
2418 --
2419 -- Name: release_monitorings release_monitorings_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2420 --
2421
2422 ALTER TABLE ONLY public.release_monitorings
2423 ADD CONSTRAINT release_monitorings_distro_id FOREIGN KEY (distro_id) REFERENCES public.distributions(id);
2424
2425
2426 --
2427 -- Name: releases releases_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2428 --
2429
2430 ALTER TABLE ONLY public.releases
2431 ADD CONSTRAINT releases_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
2432
2433
2434 --
2435 -- Name: releases releases_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2436 --
2437
2438 ALTER TABLE ONLY public.releases
2439 ADD CONSTRAINT releases_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
2440
2441
2442 --
2443 -- Name: releases releases_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2444 --
2445
2446 ALTER TABLE ONLY public.releases
2447 ADD CONSTRAINT releases_distro_id FOREIGN KEY (distro_id) REFERENCES public.distributions(id);
2448
2449
2450 --
2451 -- Name: repositories repositories_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2452 --
2453
2454 ALTER TABLE ONLY public.repositories
2455 ADD CONSTRAINT repositories_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
2456
2457
2458 --
2459 -- Name: repositories repositories_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2460 --
2461
2462 ALTER TABLE ONLY public.repositories
2463 ADD CONSTRAINT repositories_distro_id FOREIGN KEY (distro_id) REFERENCES public.distributions(id);
2464
2465
2466 --
2467 -- Name: repositories repositories_key_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2468 --
2469
2470 ALTER TABLE ONLY public.repositories
2471 ADD CONSTRAINT repositories_key_id FOREIGN KEY (key_id) REFERENCES public.keys(id);
2472
2473
2474 --
2475 -- Name: repositories repositories_owner_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2476 --
2477
2478 ALTER TABLE ONLY public.repositories
2479 ADD CONSTRAINT repositories_owner_id FOREIGN KEY (owner_id) REFERENCES public.users(id);
2480
2481
2482 --
2483 -- Name: repository_builds repository_builds_added_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2484 --
2485
2486 ALTER TABLE ONLY public.repository_builds
2487 ADD CONSTRAINT repository_builds_added_by FOREIGN KEY (added_by_id) REFERENCES public.users(id);
2488
2489
2490 --
2491 -- Name: repository_builds repository_builds_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2492 --
2493
2494 ALTER TABLE ONLY public.repository_builds
2495 ADD CONSTRAINT repository_builds_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
2496
2497
2498 --
2499 -- Name: repository_builds repository_builds_removed_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2500 --
2501
2502 ALTER TABLE ONLY public.repository_builds
2503 ADD CONSTRAINT repository_builds_removed_by FOREIGN KEY (removed_by_id) REFERENCES public.users(id);
2504
2505
2506 --
2507 -- Name: repository_builds repository_builds_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2508 --
2509
2510 ALTER TABLE ONLY public.repository_builds
2511 ADD CONSTRAINT repository_builds_repo_id FOREIGN KEY (repo_id) REFERENCES public.repositories(id);
2512
2513
2514 --
2515 -- Name: sessions sessions_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2516 --
2517
2518 ALTER TABLE ONLY public.sessions
2519 ADD CONSTRAINT sessions_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
2520
2521
2522 --
2523 -- Name: source_commit_jobs source_commit_jobs_commit_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2524 --
2525
2526 ALTER TABLE ONLY public.source_commit_jobs
2527 ADD CONSTRAINT source_commit_jobs_commit_id FOREIGN KEY (commit_id) REFERENCES public.source_commits(id);
2528
2529
2530 --
2531 -- Name: source_commits source_commits_build_group_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2532 --
2533
2534 ALTER TABLE ONLY public.source_commits
2535 ADD CONSTRAINT source_commits_build_group_id FOREIGN KEY (build_group_id) REFERENCES public.build_groups(id);
2536
2537
2538 --
2539 -- Name: source_commits sources_commits_source_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2540 --
2541
2542 ALTER TABLE ONLY public.source_commits
2543 ADD CONSTRAINT sources_commits_source_id FOREIGN KEY (source_id) REFERENCES public.sources(id);
2544
2545
2546 --
2547 -- Name: sources sources_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2548 --
2549
2550 ALTER TABLE ONLY public.sources
2551 ADD CONSTRAINT sources_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
2552
2553
2554 --
2555 -- Name: sources sources_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2556 --
2557
2558 ALTER TABLE ONLY public.sources
2559 ADD CONSTRAINT sources_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
2560
2561
2562 --
2563 -- Name: sources sources_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2564 --
2565
2566 ALTER TABLE ONLY public.sources
2567 ADD CONSTRAINT sources_repo_id FOREIGN KEY (repo_id) REFERENCES public.repositories(id);
2568
2569
2570 --
2571 -- Name: uploads uploads_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2572 --
2573
2574 ALTER TABLE ONLY public.uploads
2575 ADD CONSTRAINT uploads_builder_id FOREIGN KEY (builder_id) REFERENCES public.builders(id);
2576
2577
2578 --
2579 -- Name: uploads uploads_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2580 --
2581
2582 ALTER TABLE ONLY public.uploads
2583 ADD CONSTRAINT uploads_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
2584
2585
2586 --
2587 -- Name: user_push_subscriptions user_push_subscriptions_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2588 --
2589
2590 ALTER TABLE ONLY public.user_push_subscriptions
2591 ADD CONSTRAINT user_push_subscriptions_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
2592
2593
2594 --
2595 -- Name: SCHEMA public; Type: ACL; Schema: -; Owner: -
2596 --
2597
2598 REVOKE USAGE ON SCHEMA public FROM PUBLIC;
2599 GRANT ALL ON SCHEMA public TO PUBLIC;
2600
2601
2602 --
2603 -- PostgreSQL database dump complete
2604 --
2605