]> git.ipfire.org Git - pbs.git/blame - src/database.sql
builds: Load all builds with the group
[pbs.git] / src / database.sql
CommitLineData
9050c160 1--
64316541
MT
2-- PostgreSQL database dump
3--
4
8044a2eb
MT
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)
67fb52de 7
64316541
MT
8SET statement_timeout = 0;
9SET lock_timeout = 0;
67fb52de 10SET idle_in_transaction_session_timeout = 0;
64316541
MT
11SET client_encoding = 'UTF8';
12SET standard_conforming_strings = on;
67fb52de 13SELECT pg_catalog.set_config('search_path', '', false);
64316541 14SET check_function_bodies = false;
67fb52de 15SET xmloption = content;
64316541 16SET client_min_messages = warning;
67fb52de 17SET row_security = off;
64316541 18
b1491f00
MT
19--
20-- Name: public; Type: SCHEMA; Schema: -; Owner: -
21--
22
23-- *not* creating schema, since initdb creates it
24
25
64316541 26SET default_tablespace = '';
9050c160 27
67fb52de 28SET default_table_access_method = heap;
9050c160 29
b6bc0ea5
MT
30--
31-- Name: build_bugs; Type: TABLE; Schema: public; Owner: -
32--
33
34CREATE 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,
8044a2eb 39 added_by_id integer,
b6bc0ea5 40 removed_at timestamp without time zone,
8044a2eb 41 removed_by_id integer
b6bc0ea5
MT
42);
43
44
1523bc41 45--
ad621ea2 46-- Name: build_bugs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1523bc41
MT
47--
48
ad621ea2
MT
49CREATE 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;
1523bc41
MT
56
57
1523bc41 58--
ad621ea2 59-- Name: build_bugs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1523bc41
MT
60--
61
ad621ea2 62ALTER SEQUENCE public.build_bugs_id_seq OWNED BY public.build_bugs.id;
1523bc41
MT
63
64
65--
ad621ea2 66-- Name: build_comments; Type: TABLE; Schema: public; Owner: -
1523bc41
MT
67--
68
ad621ea2
MT
69CREATE TABLE public.build_comments (
70 id integer NOT NULL,
1523bc41
MT
71 build_id integer NOT NULL,
72 user_id integer NOT NULL,
ad621ea2
MT
73 text text DEFAULT ''::text NOT NULL,
74 created_at timestamp without time zone DEFAULT now() NOT NULL,
8044a2eb 75 deleted_at timestamp without time zone
1523bc41
MT
76);
77
78
d779a125 79--
ad621ea2 80-- Name: build_groups; Type: TABLE; Schema: public; Owner: -
d779a125
MT
81--
82
ad621ea2 83CREATE TABLE public.build_groups (
d779a125 84 id integer NOT NULL,
ad621ea2 85 uuid uuid DEFAULT gen_random_uuid() NOT NULL,
d779a125 86 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
dbd5d2a4 87 created_by_id integer,
d779a125 88 deleted_at timestamp without time zone,
dbd5d2a4 89 deleted_by_id integer,
60a07286 90 finished_at timestamp without time zone,
60a07286 91 failed boolean DEFAULT false NOT NULL,
ad621ea2 92 tested_build_id integer
ce174af5
MT
93);
94
95
b6bc0ea5 96--
ad621ea2 97-- Name: build_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: -
b6bc0ea5
MT
98--
99
ad621ea2 100CREATE SEQUENCE public.build_groups_id_seq
b6bc0ea5
MT
101 AS integer
102 START WITH 1
103 INCREMENT BY 1
104 NO MINVALUE
105 NO MAXVALUE
106 CACHE 1;
107
108
109--
ad621ea2 110-- Name: build_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
b6bc0ea5
MT
111--
112
ad621ea2 113ALTER SEQUENCE public.build_groups_id_seq OWNED BY public.build_groups.id;
b6bc0ea5
MT
114
115
668846ac 116--
ad621ea2 117-- Name: build_packages; Type: TABLE; Schema: public; Owner: -
668846ac
MT
118--
119
ad621ea2
MT
120CREATE 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);
668846ac
MT
126
127
128--
ad621ea2 129-- Name: build_points; Type: TABLE; Schema: public; Owner: -
668846ac
MT
130--
131
ad621ea2
MT
132CREATE 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);
668846ac
MT
138
139
44f74dd6 140--
ad621ea2 141-- Name: build_watchers; Type: TABLE; Schema: public; Owner: -
44f74dd6
MT
142--
143
ad621ea2 144CREATE TABLE public.build_watchers (
44f74dd6 145 build_id integer NOT NULL,
ad621ea2
MT
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
44f74dd6
MT
149);
150
151
3a4c6436 152--
c734cf6c 153-- Name: builder_stats; Type: TABLE; Schema: public; Owner: -
3a4c6436
MT
154--
155
156CREATE 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
ad621ea2
MT
187--
188-- Name: builders; Type: TABLE; Schema: public; Owner: -
189--
190
191CREATE 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,
d647d4bc 199 version text,
ad621ea2
MT
200 os_name text,
201 cpu_model text,
202 cpu_count integer DEFAULT 1 NOT NULL,
203 host_key_id text,
d647d4bc 204 arch text,
ad621ea2
MT
205 instance_id text,
206 instance_type text,
ad621ea2 207 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
c6d3b1b1 208 created_by_id integer NOT NULL,
ad621ea2 209 deleted_at timestamp without time zone,
d647d4bc
MT
210 deleted_by_id integer,
211 sys_vendor text,
f45d77c1
MT
212 sys_name text,
213 connected_at timestamp without time zone,
214 connected_from inet
ad621ea2
MT
215);
216
217
9050c160 218--
c734cf6c 219-- Name: builders_id_seq; Type: SEQUENCE; Schema: public; Owner: -
9050c160
MT
220--
221
67fb52de 222CREATE SEQUENCE public.builders_id_seq
64316541
MT
223 START WITH 1
224 INCREMENT BY 1
225 NO MINVALUE
226 NO MAXVALUE
227 CACHE 1;
228
9050c160 229
9050c160 230--
c734cf6c 231-- Name: builders_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
9050c160
MT
232--
233
67fb52de 234ALTER SEQUENCE public.builders_id_seq OWNED BY public.builders.id;
9050c160 235
9050c160 236
ad621ea2
MT
237--
238-- Name: builds; Type: TABLE; Schema: public; Owner: -
239--
240
241CREATE 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,
ad621ea2 246 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
e6ae91b3 247 repo_id integer NOT NULL,
ad621ea2
MT
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,
8044a2eb 253 deleted_by_id integer,
f6af9d79 254 group_id integer,
ad621ea2
MT
255 deprecating_build_id integer,
256 deprecated_at timestamp without time zone,
8044a2eb 257 deprecated_by_id integer,
ad621ea2
MT
258 test boolean DEFAULT false NOT NULL,
259 disable_test_builds boolean DEFAULT false NOT NULL,
22c77691
MT
260 points integer DEFAULT 0 NOT NULL,
261 commit_id integer
ad621ea2
MT
262);
263
264
189ba95b 265--
c734cf6c 266-- Name: builds_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
189ba95b 267--
189ba95b 268
67fb52de 269CREATE SEQUENCE public.builds_comments_id_seq
64316541
MT
270 START WITH 1
271 INCREMENT BY 1
272 NO MINVALUE
273 NO MAXVALUE
274 CACHE 1;
275
276
64316541 277--
c734cf6c 278-- Name: builds_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
64316541
MT
279--
280
d0f83268 281ALTER SEQUENCE public.builds_comments_id_seq OWNED BY public.build_comments.id;
64316541
MT
282
283
64316541 284--
c734cf6c 285-- Name: builds_id_seq; Type: SEQUENCE; Schema: public; Owner: -
64316541
MT
286--
287
67fb52de 288CREATE SEQUENCE public.builds_id_seq
64316541
MT
289 START WITH 1
290 INCREMENT BY 1
291 NO MINVALUE
292 NO MAXVALUE
293 CACHE 1;
294
295
64316541 296--
c734cf6c 297-- Name: builds_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
64316541
MT
298--
299
67fb52de 300ALTER SEQUENCE public.builds_id_seq OWNED BY public.builds.id;
64316541
MT
301
302
e294d6ad
MT
303--
304-- Name: cache; Type: TABLE; Schema: public; Owner: -
305--
306
307CREATE 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
64316541 315--
c734cf6c 316-- Name: distributions; Type: TABLE; Schema: public; Owner: -
64316541
MT
317--
318
67fb52de 319CREATE TABLE public.distributions (
f835411e
MT
320 id integer NOT NULL,
321 name text NOT NULL,
dad4414b 322 distro_id text NOT NULL,
8dc57b8f
MT
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,
dad4414b 327 version_id integer NOT NULL,
7ed93a91
MT
328 deleted boolean DEFAULT false NOT NULL,
329 arches text[] DEFAULT ARRAY[]::text[] NOT NULL,
19e05f59 330 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
dad4414b 331 custom_config text DEFAULT ''::text NOT NULL,
fb2a53d1
MT
332 codename text DEFAULT ''::text NOT NULL,
333 bugzilla_product text DEFAULT ''::text NOT NULL,
8044a2eb 334 bugzilla_version text DEFAULT ''::text NOT NULL,
972f4708
MT
335 deleted_at timestamp without time zone,
336 tag text GENERATED ALWAYS AS ((distro_id || version_id)) STORED
64316541
MT
337);
338
339
64316541 340--
c734cf6c 341-- Name: distributions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
64316541
MT
342--
343
67fb52de 344CREATE SEQUENCE public.distributions_id_seq
64316541
MT
345 START WITH 1
346 INCREMENT BY 1
347 NO MINVALUE
348 NO MAXVALUE
349 CACHE 1;
350
351
64316541 352--
c734cf6c 353-- Name: distributions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
64316541
MT
354--
355
67fb52de 356ALTER SEQUENCE public.distributions_id_seq OWNED BY public.distributions.id;
64316541
MT
357
358
03fd7852
MT
359--
360-- Name: images; Type: TABLE; Schema: public; Owner: -
361--
362
363CREATE 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
387CREATE 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
400ALTER SEQUENCE public.images_id_seq OWNED BY public.images.id;
401
402
64316541 403--
c734cf6c 404-- Name: images_types; Type: TABLE; Schema: public; Owner: -
64316541
MT
405--
406
67fb52de 407CREATE TABLE public.images_types (
f835411e
MT
408 id integer NOT NULL,
409 type text NOT NULL
64316541
MT
410);
411
412
64316541 413--
c734cf6c 414-- Name: images_types_id_seq; Type: SEQUENCE; Schema: public; Owner: -
64316541
MT
415--
416
67fb52de 417CREATE SEQUENCE public.images_types_id_seq
64316541
MT
418 START WITH 1
419 INCREMENT BY 1
420 NO MINVALUE
421 NO MAXVALUE
422 CACHE 1;
423
424
64316541 425--
c734cf6c 426-- Name: images_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
64316541
MT
427--
428
67fb52de 429ALTER SEQUENCE public.images_types_id_seq OWNED BY public.images_types.id;
64316541
MT
430
431
ad621ea2
MT
432--
433-- Name: job_packages; Type: TABLE; Schema: public; Owner: -
434--
435
436CREATE 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
446CREATE 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,
8044a2eb 456 superseeded_by_id integer,
ad621ea2
MT
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,
8044a2eb 466 aborted_by_id integer,
4f88a13e 467 timeout interval
ad621ea2
MT
468);
469
470
64316541 471--
c734cf6c 472-- Name: jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
64316541
MT
473--
474
67fb52de 475CREATE SEQUENCE public.jobs_id_seq
64316541
MT
476 START WITH 1
477 INCREMENT BY 1
478 NO MINVALUE
479 NO MAXVALUE
480 CACHE 1;
481
482
64316541 483--
c734cf6c 484-- Name: jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
64316541
MT
485--
486
67fb52de 487ALTER SEQUENCE public.jobs_id_seq OWNED BY public.jobs.id;
64316541
MT
488
489
64316541 490--
c734cf6c 491-- Name: keys; Type: TABLE; Schema: public; Owner: -
64316541
MT
492--
493
67fb52de 494CREATE TABLE public.keys (
f835411e 495 id integer NOT NULL,
2cb08e49 496 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
8044a2eb 497 created_by_id integer,
d779a125 498 deleted_at timestamp without time zone,
8044a2eb 499 deleted_by_id integer,
2cb08e49
MT
500 public_key text NOT NULL,
501 secret_key text NOT NULL,
5fa54345
MT
502 key_id numeric NOT NULL,
503 comment text
64316541
MT
504);
505
506
64316541 507--
c734cf6c 508-- Name: keys_id_seq; Type: SEQUENCE; Schema: public; Owner: -
64316541
MT
509--
510
67fb52de 511CREATE SEQUENCE public.keys_id_seq
d779a125 512 AS integer
64316541
MT
513 START WITH 1
514 INCREMENT BY 1
515 NO MINVALUE
516 NO MAXVALUE
517 CACHE 1;
518
519
64316541 520--
c734cf6c 521-- Name: keys_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
64316541
MT
522--
523
67fb52de 524ALTER SEQUENCE public.keys_id_seq OWNED BY public.keys.id;
64316541
MT
525
526
68dd077d 527--
c734cf6c 528-- Name: messages; Type: TABLE; Schema: public; Owner: -
68dd077d
MT
529--
530
67fb52de 531CREATE TABLE public.messages (
68dd077d
MT
532 id integer NOT NULL,
533 message text NOT NULL,
534 queued_at timestamp without time zone DEFAULT now() NOT NULL,
c58cb031
MT
535 sent_at timestamp without time zone,
536 priority integer DEFAULT 0 NOT NULL,
537 error_message text
68dd077d
MT
538);
539
540
68dd077d 541--
c734cf6c 542-- Name: messages_id_seq; Type: SEQUENCE; Schema: public; Owner: -
68dd077d
MT
543--
544
67fb52de 545CREATE SEQUENCE public.messages_id_seq
68dd077d
MT
546 START WITH 1
547 INCREMENT BY 1
548 NO MINVALUE
549 NO MAXVALUE
550 CACHE 1;
551
552
68dd077d 553--
c734cf6c 554-- Name: messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
68dd077d
MT
555--
556
67fb52de 557ALTER SEQUENCE public.messages_id_seq OWNED BY public.messages.id;
68dd077d
MT
558
559
ad621ea2
MT
560--
561-- Name: mirror_checks; Type: TABLE; Schema: public; Owner: -
562--
563
564CREATE 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
579CREATE 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,
8044a2eb 586 created_by_id integer NOT NULL,
ad621ea2 587 deleted_at timestamp without time zone,
8044a2eb 588 deleted_by_id integer,
ad621ea2
MT
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,
f966186c
MT
595 notes text DEFAULT ''::text NOT NULL,
596 addresses_ipv6 inet[] DEFAULT '{}'::inet[] NOT NULL,
597 addresses_ipv4 inet[] DEFAULT '{}'::inet[] NOT NULL
ad621ea2
MT
598);
599
600
64316541 601--
c734cf6c 602-- Name: mirrors_id_seq; Type: SEQUENCE; Schema: public; Owner: -
64316541
MT
603--
604
67fb52de 605CREATE SEQUENCE public.mirrors_id_seq
64316541
MT
606 START WITH 1
607 INCREMENT BY 1
608 NO MINVALUE
609 NO MAXVALUE
610 CACHE 1;
611
612
64316541 613--
c734cf6c 614-- Name: mirrors_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
64316541
MT
615--
616
67fb52de 617ALTER SEQUENCE public.mirrors_id_seq OWNED BY public.mirrors.id;
64316541
MT
618
619
815054ec
MT
620--
621-- Name: package_files; Type: TABLE; Schema: public; Owner: -
622--
623
624CREATE 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
ad621ea2
MT
645--
646-- Name: packages; Type: TABLE; Schema: public; Owner: -
647--
648
649CREATE TABLE public.packages (
650 id integer NOT NULL,
651 name text NOT NULL,
652 evr text NOT NULL,
653 arch text NOT NULL,
74f62763 654 groups text[] NOT NULL,
ad621ea2
MT
655 packager text,
656 license text NOT NULL,
657 url text NOT NULL,
658 summary text NOT NULL,
659 description text NOT NULL,
8044a2eb 660 size numeric NOT NULL,
6f8e50d0 661 build_arches text[],
ad621ea2
MT
662 uuid uuid NOT NULL,
663 commit_id integer,
5e6e4ee5 664 build_id uuid,
ad621ea2
MT
665 build_host text NOT NULL,
666 build_time timestamp without time zone NOT NULL,
667 path text,
8044a2eb 668 filesize numeric NOT NULL,
ad621ea2
MT
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,
8044a2eb 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
ad621ea2
MT
683);
684
685
64316541 686--
c734cf6c 687-- Name: packages_id_seq; Type: SEQUENCE; Schema: public; Owner: -
64316541
MT
688--
689
67fb52de 690CREATE SEQUENCE public.packages_id_seq
64316541
MT
691 START WITH 1
692 INCREMENT BY 1
693 NO MINVALUE
694 NO MAXVALUE
695 CACHE 1;
696
697
64316541 698--
c734cf6c 699-- Name: packages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
64316541
MT
700--
701
67fb52de 702ALTER SEQUENCE public.packages_id_seq OWNED BY public.packages.id;
64316541
MT
703
704
24da53ef
MT
705--
706-- Name: ratelimiter; Type: TABLE; Schema: public; Owner: -
707--
708
709CREATE 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
57e6621b 718--
c734cf6c 719-- Name: relation_sizes; Type: VIEW; Schema: public; Owner: -
57e6621b
MT
720--
721
67fb52de 722CREATE VIEW public.relation_sizes AS
57e6621b
MT
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]))
67fb52de 728 ORDER BY (pg_relation_size((c.oid)::regclass)) DESC;
57e6621b
MT
729
730
7e1322ca
MT
731--
732-- Name: release_images; Type: TABLE; Schema: public; Owner: -
733--
734
735CREATE 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
749CREATE 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
762ALTER SEQUENCE public.release_images_id_seq OWNED BY public.release_images.id;
763
764
3d7f0b67 765--
2913e04e 766-- Name: release_monitoring_releases; Type: TABLE; Schema: public; Owner: -
3d7f0b67
MT
767--
768
2913e04e 769CREATE TABLE public.release_monitoring_releases (
3d7f0b67 770 id integer NOT NULL,
2913e04e
MT
771 monitoring_id integer NOT NULL,
772 version text NOT NULL,
3d7f0b67 773 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
2913e04e 774 bug_id integer,
1648678e
MT
775 build_id integer,
776 diff text,
003656a3
MT
777 repo_id integer,
778 log text
3d7f0b67
MT
779);
780
781
782--
2913e04e 783-- Name: release_monitoring_releases_id_seq; Type: SEQUENCE; Schema: public; Owner: -
3d7f0b67
MT
784--
785
2913e04e 786CREATE SEQUENCE public.release_monitoring_releases_id_seq
3d7f0b67
MT
787 AS integer
788 START WITH 1
789 INCREMENT BY 1
790 NO MINVALUE
791 NO MAXVALUE
792 CACHE 1;
793
794
795--
2913e04e 796-- Name: release_monitoring_releases_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
3d7f0b67
MT
797--
798
2913e04e 799ALTER SEQUENCE public.release_monitoring_releases_id_seq OWNED BY public.release_monitoring_releases.id;
3d7f0b67
MT
800
801
ad621ea2
MT
802--
803-- Name: release_monitorings; Type: TABLE; Schema: public; Owner: -
804--
805
806CREATE 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,
8044a2eb 811 created_by_id integer NOT NULL,
ad621ea2 812 deleted_at timestamp without time zone,
8044a2eb 813 deleted_by_id integer,
ad621ea2
MT
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
3d7f0b67 821--
2913e04e 822-- Name: release_monitorings_id_seq; Type: SEQUENCE; Schema: public; Owner: -
3d7f0b67
MT
823--
824
2913e04e 825CREATE SEQUENCE public.release_monitorings_id_seq
3d7f0b67
MT
826 AS integer
827 START WITH 1
828 INCREMENT BY 1
829 NO MINVALUE
830 NO MAXVALUE
831 CACHE 1;
832
833
834--
2913e04e 835-- Name: release_monitorings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
3d7f0b67
MT
836--
837
2913e04e 838ALTER SEQUENCE public.release_monitorings_id_seq OWNED BY public.release_monitorings.id;
3d7f0b67
MT
839
840
ad621ea2
MT
841--
842-- Name: releases; Type: TABLE; Schema: public; Owner: -
843--
844
845CREATE 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,
8044a2eb 851 created_by_id integer NOT NULL,
ad621ea2 852 deleted_at timestamp without time zone,
8044a2eb 853 deleted_by_id integer,
ad621ea2
MT
854 published_at timestamp without time zone,
855 stable boolean DEFAULT false NOT NULL,
856 announcement text
857);
858
859
7e1322ca
MT
860--
861-- Name: releases_id_seq; Type: SEQUENCE; Schema: public; Owner: -
862--
863
864CREATE 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
877ALTER SEQUENCE public.releases_id_seq OWNED BY public.releases.id;
878
879
64316541 880--
c734cf6c 881-- Name: repositories; Type: TABLE; Schema: public; Owner: -
64316541
MT
882--
883
67fb52de 884CREATE TABLE public.repositories (
f835411e
MT
885 id integer NOT NULL,
886 name text NOT NULL,
6dcd5a97 887 slug text NOT NULL,
19e05f59 888 description text DEFAULT ''::text NOT NULL,
f835411e 889 distro_id integer NOT NULL,
9fb4cda3 890 key_id integer NOT NULL,
fe47bbac 891 mirrored boolean DEFAULT false NOT NULL,
ed2e72d4 892 updated_at timestamp without time zone,
6dcd5a97 893 deleted_at timestamp without time zone,
a7a18be1 894 priority integer,
f87d64a2 895 owner_id integer,
f87d64a2 896 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
fe17d32f
MT
897 listed boolean DEFAULT true NOT NULL,
898 deleted_by integer
64316541
MT
899);
900
901
cb866740 902--
ee20e731 903-- Name: repositories_id_seq; Type: SEQUENCE; Schema: public; Owner: -
64316541
MT
904--
905
ee20e731 906CREATE SEQUENCE public.repositories_id_seq
64316541
MT
907 START WITH 1
908 INCREMENT BY 1
909 NO MINVALUE
910 NO MAXVALUE
911 CACHE 1;
912
913
64316541 914--
ee20e731 915-- Name: repositories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
64316541
MT
916--
917
ee20e731 918ALTER SEQUENCE public.repositories_id_seq OWNED BY public.repositories.id;
64316541
MT
919
920
ad621ea2
MT
921--
922-- Name: repository_builds; Type: TABLE; Schema: public; Owner: -
923--
924
925CREATE 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,
8044a2eb 930 added_by_id integer,
ad621ea2 931 removed_at timestamp without time zone,
8044a2eb 932 removed_by_id integer
ad621ea2
MT
933);
934
935
ee20e731
MT
936--
937-- Name: repository_builds_id_seq; Type: SEQUENCE; Schema: public; Owner: -
938--
939
940CREATE SEQUENCE public.repository_builds_id_seq
64316541
MT
941 START WITH 1
942 INCREMENT BY 1
943 NO MINVALUE
944 NO MAXVALUE
945 CACHE 1;
946
947
64316541 948--
ee20e731 949-- Name: repository_builds_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
64316541
MT
950--
951
ee20e731 952ALTER SEQUENCE public.repository_builds_id_seq OWNED BY public.repository_builds.id;
64316541
MT
953
954
955--
c734cf6c 956-- Name: sessions; Type: TABLE; Schema: public; Owner: -
64316541
MT
957--
958
67fb52de 959CREATE TABLE public.sessions (
d2738057 960 id integer NOT NULL,
9f5a24c1
MT
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,
f835411e 964 user_id integer NOT NULL,
d2738057 965 address inet,
70987fab 966 user_agent text
64316541
MT
967);
968
969
d2738057 970--
c734cf6c 971-- Name: sessions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
d2738057
MT
972--
973
67fb52de 974CREATE SEQUENCE public.sessions_id_seq
d2738057
MT
975 START WITH 1
976 INCREMENT BY 1
977 NO MINVALUE
978 NO MAXVALUE
979 CACHE 1;
980
981
d2738057 982--
c734cf6c 983-- Name: sessions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
d2738057
MT
984--
985
67fb52de 986ALTER SEQUENCE public.sessions_id_seq OWNED BY public.sessions.id;
d2738057
MT
987
988
07c337e7
MT
989--
990-- Name: source_commit_jobs; Type: TABLE; Schema: public; Owner: -
991--
992
993CREATE 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,
1da6e9fd 998 finished_at timestamp without time zone,
07c337e7 999 success boolean,
9ee5dce3
MT
1000 error text,
1001 log text
07c337e7
MT
1002);
1003
1004
1005--
1006-- Name: source_commit_jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1007--
1008
1009CREATE 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
1022ALTER SEQUENCE public.source_commit_jobs_id_seq OWNED BY public.source_commit_jobs.id;
1023
1024
64316541 1025--
c701b87e 1026-- Name: source_commits; Type: TABLE; Schema: public; Owner: -
64316541
MT
1027--
1028
c701b87e 1029CREATE TABLE public.source_commits (
f835411e
MT
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,
64316541 1036 body text NOT NULL,
f835411e 1037 date timestamp without time zone NOT NULL,
07c337e7
MT
1038 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
1039 deleted_at timestamp without time zone,
1da6e9fd
MT
1040 build_group_id integer,
1041 finished_at timestamp without time zone
64316541
MT
1042);
1043
1044
07c337e7
MT
1045--
1046-- Name: source_commits_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1047--
1048
1049CREATE 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
1061ALTER SEQUENCE public.source_commits_id_seq OWNED BY public.source_commits.id;
1062
1063
c701b87e
MT
1064--
1065-- Name: sources; Type: TABLE; Schema: public; Owner: -
1066--
1067
1068CREATE 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,
ad621ea2 1074 revision text,
c701b87e 1075 branch text NOT NULL,
1da6e9fd 1076 last_fetched_at timestamp without time zone,
c701b87e
MT
1077 repo_id integer NOT NULL,
1078 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
8044a2eb 1079 created_by_id integer NOT NULL,
c701b87e 1080 deleted_at timestamp without time zone,
8044a2eb 1081 deleted_by_id integer
c701b87e
MT
1082);
1083
1084
64316541 1085--
c734cf6c 1086-- Name: sources_id_seq; Type: SEQUENCE; Schema: public; Owner: -
64316541
MT
1087--
1088
67fb52de 1089CREATE SEQUENCE public.sources_id_seq
64316541
MT
1090 START WITH 1
1091 INCREMENT BY 1
1092 NO MINVALUE
1093 NO MAXVALUE
1094 CACHE 1;
1095
1096
64316541 1097--
c734cf6c 1098-- Name: sources_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
64316541
MT
1099--
1100
67fb52de 1101ALTER SEQUENCE public.sources_id_seq OWNED BY public.sources.id;
64316541
MT
1102
1103
ad621ea2
MT
1104--
1105-- Name: uploads; Type: TABLE; Schema: public; Owner: -
1106--
1107
1108CREATE 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,
bd686a79 1114 path text,
ad621ea2
MT
1115 size bigint NOT NULL,
1116 created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
bd686a79 1117 expires_at timestamp without time zone DEFAULT (CURRENT_TIMESTAMP + '24:00:00'::interval) NOT NULL,
1681783d 1118 digest_blake2b512 bytea NOT NULL
ad621ea2
MT
1119);
1120
1121
64316541 1122--
c734cf6c 1123-- Name: uploads_id_seq; Type: SEQUENCE; Schema: public; Owner: -
64316541
MT
1124--
1125
96bcb9e7 1126CREATE SEQUENCE public.uploads_id_seq
64316541
MT
1127 START WITH 1
1128 INCREMENT BY 1
1129 NO MINVALUE
1130 NO MAXVALUE
1131 CACHE 1;
1132
1133
64316541 1134--
c734cf6c 1135-- Name: uploads_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
64316541
MT
1136--
1137
96bcb9e7 1138ALTER SEQUENCE public.uploads_id_seq OWNED BY public.uploads.id;
64316541
MT
1139
1140
d48f75f7
MT
1141--
1142-- Name: user_push_subscriptions; Type: TABLE; Schema: public; Owner: -
1143--
1144
1145CREATE 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
1162CREATE 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
1175ALTER SEQUENCE public.user_push_subscriptions_id_seq OWNED BY public.user_push_subscriptions.id;
1176
1177
64316541 1178--
c734cf6c 1179-- Name: users; Type: TABLE; Schema: public; Owner: -
64316541
MT
1180--
1181
67fb52de 1182CREATE TABLE public.users (
f835411e
MT
1183 id integer NOT NULL,
1184 name text NOT NULL,
6e0c9ad4 1185 deleted_at timestamp without time zone,
b01825aa 1186 registered_at timestamp without time zone DEFAULT now() NOT NULL,
50533a78 1187 admin boolean DEFAULT false NOT NULL,
2275518a 1188 storage_quota bigint,
857a7836 1189 perms text[] DEFAULT ARRAY[]::text[] NOT NULL,
c8550381 1190 _attrs bytea,
bffb4fc5
MT
1191 bugzilla_api_key text,
1192 daily_build_quota interval
64316541
MT
1193);
1194
1195
64316541 1196--
c734cf6c 1197-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
64316541
MT
1198--
1199
67fb52de 1200CREATE SEQUENCE public.users_id_seq
64316541
MT
1201 START WITH 1
1202 INCREMENT BY 1
1203 NO MINVALUE
1204 NO MAXVALUE
1205 CACHE 1;
1206
1207
64316541 1208--
c734cf6c 1209-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
64316541
MT
1210--
1211
67fb52de 1212ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
64316541
MT
1213
1214
b6bc0ea5
MT
1215--
1216-- Name: build_bugs id; Type: DEFAULT; Schema: public; Owner: -
1217--
1218
1219ALTER TABLE ONLY public.build_bugs ALTER COLUMN id SET DEFAULT nextval('public.build_bugs_id_seq'::regclass);
1220
1221
d0f83268
MT
1222--
1223-- Name: build_comments id; Type: DEFAULT; Schema: public; Owner: -
1224--
1225
1226ALTER TABLE ONLY public.build_comments ALTER COLUMN id SET DEFAULT nextval('public.builds_comments_id_seq'::regclass);
1227
1228
668846ac
MT
1229--
1230-- Name: build_groups id; Type: DEFAULT; Schema: public; Owner: -
1231--
1232
1233ALTER TABLE ONLY public.build_groups ALTER COLUMN id SET DEFAULT nextval('public.build_groups_id_seq'::regclass);
1234
1235
64316541 1236--
c734cf6c 1237-- Name: builders id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1238--
1239
67fb52de 1240ALTER TABLE ONLY public.builders ALTER COLUMN id SET DEFAULT nextval('public.builders_id_seq'::regclass);
64316541
MT
1241
1242
64316541 1243--
c734cf6c 1244-- Name: builds id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1245--
1246
67fb52de 1247ALTER TABLE ONLY public.builds ALTER COLUMN id SET DEFAULT nextval('public.builds_id_seq'::regclass);
64316541
MT
1248
1249
64316541 1250--
c734cf6c 1251-- Name: distributions id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1252--
1253
67fb52de 1254ALTER TABLE ONLY public.distributions ALTER COLUMN id SET DEFAULT nextval('public.distributions_id_seq'::regclass);
64316541
MT
1255
1256
03fd7852
MT
1257--
1258-- Name: images id; Type: DEFAULT; Schema: public; Owner: -
1259--
1260
1261ALTER TABLE ONLY public.images ALTER COLUMN id SET DEFAULT nextval('public.images_id_seq'::regclass);
1262
1263
64316541 1264--
c734cf6c 1265-- Name: images_types id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1266--
1267
67fb52de 1268ALTER TABLE ONLY public.images_types ALTER COLUMN id SET DEFAULT nextval('public.images_types_id_seq'::regclass);
64316541
MT
1269
1270
1271--
c734cf6c 1272-- Name: jobs id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1273--
1274
67fb52de 1275ALTER TABLE ONLY public.jobs ALTER COLUMN id SET DEFAULT nextval('public.jobs_id_seq'::regclass);
64316541
MT
1276
1277
64316541 1278--
c734cf6c 1279-- Name: keys id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1280--
1281
67fb52de 1282ALTER TABLE ONLY public.keys ALTER COLUMN id SET DEFAULT nextval('public.keys_id_seq'::regclass);
64316541
MT
1283
1284
68dd077d 1285--
c734cf6c 1286-- Name: messages id; Type: DEFAULT; Schema: public; Owner: -
68dd077d
MT
1287--
1288
67fb52de 1289ALTER TABLE ONLY public.messages ALTER COLUMN id SET DEFAULT nextval('public.messages_id_seq'::regclass);
68dd077d
MT
1290
1291
64316541 1292--
c734cf6c 1293-- Name: mirrors id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1294--
1295
67fb52de 1296ALTER TABLE ONLY public.mirrors ALTER COLUMN id SET DEFAULT nextval('public.mirrors_id_seq'::regclass);
64316541
MT
1297
1298
64316541 1299--
c734cf6c 1300-- Name: packages id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1301--
1302
67fb52de 1303ALTER TABLE ONLY public.packages ALTER COLUMN id SET DEFAULT nextval('public.packages_id_seq'::regclass);
64316541
MT
1304
1305
7e1322ca
MT
1306--
1307-- Name: release_images id; Type: DEFAULT; Schema: public; Owner: -
1308--
1309
1310ALTER TABLE ONLY public.release_images ALTER COLUMN id SET DEFAULT nextval('public.release_images_id_seq'::regclass);
1311
1312
3d7f0b67 1313--
2913e04e 1314-- Name: release_monitoring_releases id; Type: DEFAULT; Schema: public; Owner: -
3d7f0b67
MT
1315--
1316
2913e04e 1317ALTER TABLE ONLY public.release_monitoring_releases ALTER COLUMN id SET DEFAULT nextval('public.release_monitoring_releases_id_seq'::regclass);
3d7f0b67
MT
1318
1319
1320--
2913e04e 1321-- Name: release_monitorings id; Type: DEFAULT; Schema: public; Owner: -
3d7f0b67
MT
1322--
1323
2913e04e 1324ALTER TABLE ONLY public.release_monitorings ALTER COLUMN id SET DEFAULT nextval('public.release_monitorings_id_seq'::regclass);
3d7f0b67
MT
1325
1326
7e1322ca
MT
1327--
1328-- Name: releases id; Type: DEFAULT; Schema: public; Owner: -
1329--
1330
1331ALTER TABLE ONLY public.releases ALTER COLUMN id SET DEFAULT nextval('public.releases_id_seq'::regclass);
1332
1333
64316541 1334--
c734cf6c 1335-- Name: repositories id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1336--
1337
67fb52de 1338ALTER TABLE ONLY public.repositories ALTER COLUMN id SET DEFAULT nextval('public.repositories_id_seq'::regclass);
64316541
MT
1339
1340
64316541 1341--
ee20e731 1342-- Name: repository_builds id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1343--
1344
ee20e731 1345ALTER TABLE ONLY public.repository_builds ALTER COLUMN id SET DEFAULT nextval('public.repository_builds_id_seq'::regclass);
64316541
MT
1346
1347
d2738057 1348--
c734cf6c 1349-- Name: sessions id; Type: DEFAULT; Schema: public; Owner: -
d2738057
MT
1350--
1351
67fb52de 1352ALTER TABLE ONLY public.sessions ALTER COLUMN id SET DEFAULT nextval('public.sessions_id_seq'::regclass);
d2738057
MT
1353
1354
07c337e7
MT
1355--
1356-- Name: source_commit_jobs id; Type: DEFAULT; Schema: public; Owner: -
1357--
1358
1359ALTER TABLE ONLY public.source_commit_jobs ALTER COLUMN id SET DEFAULT nextval('public.source_commit_jobs_id_seq'::regclass);
1360
1361
64316541 1362--
c701b87e 1363-- Name: source_commits id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1364--
1365
07c337e7 1366ALTER TABLE ONLY public.source_commits ALTER COLUMN id SET DEFAULT nextval('public.source_commits_id_seq'::regclass);
64316541
MT
1367
1368
1369--
c701b87e 1370-- Name: sources id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1371--
1372
c701b87e 1373ALTER TABLE ONLY public.sources ALTER COLUMN id SET DEFAULT nextval('public.sources_id_seq'::regclass);
64316541
MT
1374
1375
1376--
c734cf6c 1377-- Name: uploads id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1378--
1379
67fb52de 1380ALTER TABLE ONLY public.uploads ALTER COLUMN id SET DEFAULT nextval('public.uploads_id_seq'::regclass);
64316541
MT
1381
1382
d48f75f7
MT
1383--
1384-- Name: user_push_subscriptions id; Type: DEFAULT; Schema: public; Owner: -
1385--
1386
1387ALTER TABLE ONLY public.user_push_subscriptions ALTER COLUMN id SET DEFAULT nextval('public.user_push_subscriptions_id_seq'::regclass);
1388
1389
64316541 1390--
c734cf6c 1391-- Name: users id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1392--
1393
67fb52de 1394ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
64316541
MT
1395
1396
b6bc0ea5
MT
1397--
1398-- Name: build_bugs build_bugs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1399--
1400
1401ALTER TABLE ONLY public.build_bugs
1402 ADD CONSTRAINT build_bugs_pkey PRIMARY KEY (id);
1403
1404
d0f83268
MT
1405--
1406-- Name: build_comments build_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1407--
1408
1409ALTER TABLE ONLY public.build_comments
1410 ADD CONSTRAINT build_comments_pkey PRIMARY KEY (id);
1411
1412
668846ac
MT
1413--
1414-- Name: build_groups build_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1415--
1416
1417ALTER TABLE ONLY public.build_groups
1418 ADD CONSTRAINT build_groups_pkey PRIMARY KEY (id);
1419
1420
44f74dd6 1421--
c734cf6c 1422-- Name: builds builds_pkey; Type: CONSTRAINT; Schema: public; Owner: -
44f74dd6
MT
1423--
1424
1425ALTER TABLE ONLY public.builds
1426 ADD CONSTRAINT builds_pkey PRIMARY KEY (id);
1427
1428
e294d6ad
MT
1429--
1430-- Name: cache cache_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1431--
1432
1433ALTER TABLE ONLY public.cache
1434 ADD CONSTRAINT cache_pkey PRIMARY KEY (key);
1435
1436
7ed93a91 1437--
c734cf6c 1438-- Name: distributions distributions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
7ed93a91
MT
1439--
1440
1441ALTER TABLE ONLY public.distributions
1442 ADD CONSTRAINT distributions_pkey PRIMARY KEY (id);
1443
1444
64316541 1445--
c734cf6c 1446-- Name: builders idx_2197954_primary; Type: CONSTRAINT; Schema: public; Owner: -
64316541
MT
1447--
1448
67fb52de 1449ALTER TABLE ONLY public.builders
64316541
MT
1450 ADD CONSTRAINT idx_2197954_primary PRIMARY KEY (id);
1451
1452
64316541 1453--
ad1545f1 1454-- Name: images_types image_types_pkey; Type: CONSTRAINT; Schema: public; Owner: -
64316541
MT
1455--
1456
67fb52de 1457ALTER TABLE ONLY public.images_types
ad1545f1 1458 ADD CONSTRAINT image_types_pkey PRIMARY KEY (id);
64316541
MT
1459
1460
03fd7852
MT
1461--
1462-- Name: images images_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1463--
1464
1465ALTER 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
1473ALTER TABLE ONLY public.images
1474 ADD CONSTRAINT images_unique UNIQUE (release_id, type, arch);
1475
1476
02de33ff 1477--
c734cf6c 1478-- Name: jobs jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
02de33ff
MT
1479--
1480
1481ALTER TABLE ONLY public.jobs
1482 ADD CONSTRAINT jobs_pkey PRIMARY KEY (id);
1483
1484
2cb08e49 1485--
c734cf6c 1486-- Name: keys keys_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2cb08e49
MT
1487--
1488
1489ALTER TABLE ONLY public.keys
1490 ADD CONSTRAINT keys_pkey PRIMARY KEY (id);
1491
1492
c58cb031
MT
1493--
1494-- Name: messages messages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1495--
1496
1497ALTER TABLE ONLY public.messages
1498 ADD CONSTRAINT messages_pkey PRIMARY KEY (id);
1499
1500
c660ff59 1501--
1523bc41 1502-- Name: mirrors mirrors_pkey; Type: CONSTRAINT; Schema: public; Owner: -
c660ff59
MT
1503--
1504
1523bc41
MT
1505ALTER TABLE ONLY public.mirrors
1506 ADD CONSTRAINT mirrors_pkey PRIMARY KEY (id);
c660ff59
MT
1507
1508
650791fb 1509--
c734cf6c 1510-- Name: packages packages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
650791fb
MT
1511--
1512
1513ALTER TABLE ONLY public.packages
1514 ADD CONSTRAINT packages_pkey PRIMARY KEY (id);
1515
1516
1a1bbf64
MT
1517--
1518-- Name: ratelimiter ratelimiter_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1519--
1520
1521ALTER TABLE ONLY public.ratelimiter
1522 ADD CONSTRAINT ratelimiter_pkey PRIMARY KEY (key, "timestamp", address);
1523
1524
24da53ef
MT
1525--
1526-- Name: ratelimiter ratelimiter_unique; Type: CONSTRAINT; Schema: public; Owner: -
1527--
1528
1529ALTER TABLE ONLY public.ratelimiter
1530 ADD CONSTRAINT ratelimiter_unique UNIQUE (key, "timestamp", address);
1531
1532
7e1322ca
MT
1533--
1534-- Name: release_images release_images_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1535--
1536
1537ALTER TABLE ONLY public.release_images
1538 ADD CONSTRAINT release_images_pkey PRIMARY KEY (id);
1539
1540
3d7f0b67 1541--
2913e04e 1542-- Name: release_monitoring_releases release_monitoring_releases_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3d7f0b67
MT
1543--
1544
2913e04e
MT
1545ALTER TABLE ONLY public.release_monitoring_releases
1546 ADD CONSTRAINT release_monitoring_releases_pkey PRIMARY KEY (id);
3d7f0b67
MT
1547
1548
1549--
2913e04e 1550-- Name: release_monitorings release_monitorings_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3d7f0b67
MT
1551--
1552
2913e04e
MT
1553ALTER TABLE ONLY public.release_monitorings
1554 ADD CONSTRAINT release_monitorings_pkey PRIMARY KEY (id);
3d7f0b67
MT
1555
1556
7e1322ca
MT
1557--
1558-- Name: releases releases_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1559--
1560
1561ALTER TABLE ONLY public.releases
1562 ADD CONSTRAINT releases_pkey PRIMARY KEY (id);
1563
1564
29fb7c98 1565--
ee20e731 1566-- Name: repositories repositories_pkey; Type: CONSTRAINT; Schema: public; Owner: -
29fb7c98
MT
1567--
1568
ee20e731
MT
1569ALTER TABLE ONLY public.repositories
1570 ADD CONSTRAINT repositories_pkey PRIMARY KEY (id);
29fb7c98
MT
1571
1572
f87d64a2 1573--
ee20e731 1574-- Name: repository_builds repository_builds_pkey; Type: CONSTRAINT; Schema: public; Owner: -
f87d64a2
MT
1575--
1576
ee20e731
MT
1577ALTER TABLE ONLY public.repository_builds
1578 ADD CONSTRAINT repository_builds_pkey PRIMARY KEY (id);
f87d64a2
MT
1579
1580
d2738057 1581--
c734cf6c 1582-- Name: sessions sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
d2738057
MT
1583--
1584
67fb52de 1585ALTER TABLE ONLY public.sessions
d2738057
MT
1586 ADD CONSTRAINT sessions_pkey PRIMARY KEY (id);
1587
1588
1589--
c734cf6c 1590-- Name: sessions sessions_session_id_key; Type: CONSTRAINT; Schema: public; Owner: -
d2738057
MT
1591--
1592
67fb52de 1593ALTER TABLE ONLY public.sessions
d2738057
MT
1594 ADD CONSTRAINT sessions_session_id_key UNIQUE (session_id);
1595
1596
07c337e7
MT
1597--
1598-- Name: source_commit_jobs source_commit_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1599--
1600
1601ALTER TABLE ONLY public.source_commit_jobs
1602 ADD CONSTRAINT source_commit_jobs_pkey PRIMARY KEY (id);
1603
1604
c701b87e
MT
1605--
1606-- Name: source_commits source_commits_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1607--
1608
1609ALTER 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
1617ALTER TABLE ONLY public.sources
1618 ADD CONSTRAINT sources_pkey PRIMARY KEY (id);
1619
1620
8b4010c2 1621--
c734cf6c 1622-- Name: uploads uploads_id; Type: CONSTRAINT; Schema: public; Owner: -
8b4010c2
MT
1623--
1624
67fb52de
MT
1625ALTER TABLE ONLY public.uploads
1626 ADD CONSTRAINT uploads_id PRIMARY KEY (id);
8b4010c2
MT
1627
1628
d48f75f7
MT
1629--
1630-- Name: user_push_subscriptions user_push_subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1631--
1632
1633ALTER TABLE ONLY public.user_push_subscriptions
1634 ADD CONSTRAINT user_push_subscriptions_pkey PRIMARY KEY (id);
1635
1636
476719e1
MT
1637--
1638-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1639--
1640
1641ALTER TABLE ONLY public.users
1642 ADD CONSTRAINT users_pkey PRIMARY KEY (id);
1643
1644
b6bc0ea5
MT
1645--
1646-- Name: build_bugs_unique; Type: INDEX; Schema: public; Owner: -
1647--
1648
1649CREATE UNIQUE INDEX build_bugs_unique ON public.build_bugs USING btree (build_id, bug_id) WHERE (removed_at IS NULL);
1650
1651
668846ac
MT
1652--
1653-- Name: build_groups_uuid; Type: INDEX; Schema: public; Owner: -
1654--
1655
a9a942b5 1656CREATE UNIQUE INDEX build_groups_uuid ON public.build_groups USING btree (uuid) WHERE (deleted_at IS NULL);
668846ac
MT
1657
1658
e704b8e2 1659--
c734cf6c 1660-- Name: build_packages_build_id; Type: INDEX; Schema: public; Owner: -
e704b8e2
MT
1661--
1662
44f74dd6 1663CREATE INDEX build_packages_build_id ON public.build_packages USING btree (build_id);
439d364e
MT
1664
1665
100b864f
MT
1666--
1667-- Name: build_points_build_id; Type: INDEX; Schema: public; Owner: -
1668--
1669
1670CREATE INDEX build_points_build_id ON public.build_points USING btree (build_id);
1671
1672
6c6380e1
MT
1673--
1674-- Name: build_watchers_unique; Type: INDEX; Schema: public; Owner: -
1675--
1676
1677CREATE UNIQUE INDEX build_watchers_unique ON public.build_watchers USING btree (build_id, user_id) WHERE (deleted_at IS NULL);
1678
1679
e459cbba 1680--
c734cf6c 1681-- Name: builders_name; Type: INDEX; Schema: public; Owner: -
e459cbba
MT
1682--
1683
e844251a 1684CREATE UNIQUE INDEX builders_name ON public.builders USING btree (name) WHERE (deleted_at IS NULL);
e459cbba
MT
1685
1686
668846ac
MT
1687--
1688-- Name: builds_build_group_id; Type: INDEX; Schema: public; Owner: -
1689--
1690
f6af9d79 1691CREATE INDEX builds_build_group_id ON public.builds USING btree (group_id) WHERE (deleted_at IS NULL);
668846ac
MT
1692
1693
64316541 1694--
c734cf6c 1695-- Name: builds_created_at; Type: INDEX; Schema: public; Owner: -
64316541
MT
1696--
1697
7ff8f45a 1698CREATE INDEX builds_created_at ON public.builds USING btree (created_at DESC) WHERE (deleted_at IS NULL);
64316541
MT
1699
1700
b6463980
MT
1701--
1702-- Name: builds_deleted; Type: INDEX; Schema: public; Owner: -
1703--
1704
1705CREATE INDEX builds_deleted ON public.builds USING btree (deleted_at) WHERE (deleted_at IS NOT NULL);
1706
1707
984b00df 1708--
29b3094b 1709-- Name: builds_deprecating_build_id; Type: INDEX; Schema: public; Owner: -
984b00df
MT
1710--
1711
29b3094b 1712CREATE INDEX builds_deprecating_build_id ON public.builds USING btree (deprecating_build_id) WHERE ((deleted_at IS NULL) AND (deprecated_at IS NOT NULL));
984b00df
MT
1713
1714
5f08ee36
MT
1715--
1716-- Name: builds_not_tests; Type: INDEX; Schema: public; Owner: -
1717--
1718
1719CREATE UNIQUE INDEX builds_not_tests ON public.builds USING btree (id) WHERE ((test IS FALSE) AND (deleted_at IS NULL));
1720
1721
8066bbf3 1722--
c734cf6c 1723-- Name: builds_pkg_id; Type: INDEX; Schema: public; Owner: -
8066bbf3
MT
1724--
1725
7ff8f45a 1726CREATE INDEX builds_pkg_id ON public.builds USING btree (pkg_id) WHERE (deleted_at IS NULL);
8066bbf3
MT
1727
1728
68180d16
MT
1729--
1730-- Name: builds_scratch_builds; Type: INDEX; Schema: public; Owner: -
1731--
1732
35f09e86 1733CREATE 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));
68180d16
MT
1734
1735
64316541 1736--
c734cf6c 1737-- Name: builds_uuid; Type: INDEX; Schema: public; Owner: -
64316541
MT
1738--
1739
7ff8f45a 1740CREATE UNIQUE INDEX builds_uuid ON public.builds USING btree (uuid) WHERE (deleted_at IS NULL);
64316541
MT
1741
1742
972f4708
MT
1743--
1744-- Name: distributions_tag; Type: INDEX; Schema: public; Owner: -
1745--
1746
1747CREATE UNIQUE INDEX distributions_tag ON public.distributions USING btree (tag) WHERE (deleted_at IS NULL);
1748
1749
64316541 1750--
dad4414b 1751-- Name: distributions_unique; Type: INDEX; Schema: public; Owner: -
64316541
MT
1752--
1753
dad4414b 1754CREATE UNIQUE INDEX distributions_unique ON public.distributions USING btree (distro_id, version_id) WHERE (deleted IS FALSE);
64316541
MT
1755
1756
cbcacbc9
MT
1757--
1758-- Name: job_packages_job_id; Type: INDEX; Schema: public; Owner: -
1759--
1760
1761CREATE 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
1768CREATE UNIQUE INDEX job_packages_pkg_id ON public.job_packages USING btree (pkg_id);
1769
1770
3d743a8e 1771--
c734cf6c 1772-- Name: jobs_arch; Type: INDEX; Schema: public; Owner: -
3d743a8e
MT
1773--
1774
67fb52de 1775CREATE INDEX jobs_arch ON public.jobs USING btree (arch);
3d743a8e
MT
1776
1777
0a0d8db7 1778--
c734cf6c 1779-- Name: jobs_build_id; Type: INDEX; Schema: public; Owner: -
0a0d8db7
MT
1780--
1781
dfa73e6f 1782CREATE INDEX jobs_build_id ON public.jobs USING btree (build_id) WHERE (deleted_at IS NULL);
0a0d8db7
MT
1783
1784
e0e14322 1785--
c734cf6c 1786-- Name: jobs_finished_at; Type: INDEX; Schema: public; Owner: -
02de33ff
MT
1787--
1788
1789CREATE INDEX jobs_finished_at ON public.jobs USING btree (finished_at DESC) WHERE (finished_at IS NOT NULL);
1790
1791
1792--
c734cf6c 1793-- Name: jobs_pending; Type: INDEX; Schema: public; Owner: -
e0e14322
MT
1794--
1795
a08f4acc 1796CREATE 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));
e0e14322
MT
1797
1798
1b1f4a37 1799--
c734cf6c 1800-- Name: jobs_running; Type: INDEX; Schema: public; Owner: -
1b1f4a37
MT
1801--
1802
9689a8c3 1803CREATE 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));
1b1f4a37
MT
1804
1805
581c1ead
MT
1806--
1807-- Name: jobs_superseeded_by; Type: INDEX; Schema: public; Owner: -
1808--
1809
8044a2eb 1810CREATE INDEX jobs_superseeded_by ON public.jobs USING btree (superseeded_by_id);
581c1ead
MT
1811
1812
de667c37 1813--
c734cf6c 1814-- Name: jobs_uuid; Type: INDEX; Schema: public; Owner: -
de667c37
MT
1815--
1816
dfa73e6f 1817CREATE UNIQUE INDEX jobs_uuid ON public.jobs USING btree (uuid) WHERE (deleted_at IS NULL);
de667c37
MT
1818
1819
68dd077d 1820--
c58cb031 1821-- Name: messages_queued; Type: INDEX; Schema: public; Owner: -
68dd077d
MT
1822--
1823
c58cb031 1824CREATE INDEX messages_queued ON public.messages USING btree (priority DESC, queued_at) WHERE (sent_at IS NULL);
68dd077d
MT
1825
1826
c660ff59 1827--
1523bc41 1828-- Name: mirror_checks_search; Type: INDEX; Schema: public; Owner: -
c660ff59
MT
1829--
1830
1523bc41
MT
1831CREATE 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--
67fb52de 1837
1523bc41 1838CREATE UNIQUE INDEX mirrors_hostname ON public.mirrors USING btree (hostname) WHERE (deleted_at IS NULL);
67fb52de
MT
1839
1840
0d66487a
MT
1841--
1842-- Name: package_files_path; Type: INDEX; Schema: public; Owner: -
1843--
1844
1845CREATE 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
1852CREATE INDEX package_files_pkg_id ON public.package_files USING btree (pkg_id);
1853
1854
091eb763 1855--
5f08ee36 1856-- Name: packages_name; Type: INDEX; Schema: public; Owner: -
091eb763
MT
1857--
1858
5f08ee36 1859CREATE INDEX packages_name ON public.packages USING btree (name);
091eb763
MT
1860
1861
650791fb 1862--
5f08ee36 1863-- Name: packages_search; Type: INDEX; Schema: public; Owner: -
650791fb
MT
1864--
1865
8044a2eb 1866CREATE INDEX packages_search ON public.packages USING gin (search) WHERE (deleted_at IS NULL);
650791fb
MT
1867
1868
d779a125
MT
1869--
1870-- Name: release_monitoring_releases_build_id; Type: INDEX; Schema: public; Owner: -
1871--
1872
1873CREATE INDEX release_monitoring_releases_build_id ON public.release_monitoring_releases USING btree (build_id);
1874
1875
3d7f0b67 1876--
2913e04e 1877-- Name: release_monitoring_releases_search; Type: INDEX; Schema: public; Owner: -
3d7f0b67
MT
1878--
1879
2913e04e 1880CREATE INDEX release_monitoring_releases_search ON public.release_monitoring_releases USING btree (monitoring_id, created_at);
3d7f0b67
MT
1881
1882
1883--
2913e04e 1884-- Name: release_monitoring_releases_unique; Type: INDEX; Schema: public; Owner: -
3d7f0b67
MT
1885--
1886
2913e04e 1887CREATE UNIQUE INDEX release_monitoring_releases_unique ON public.release_monitoring_releases USING btree (monitoring_id, version);
3d7f0b67
MT
1888
1889
1890--
2913e04e 1891-- Name: release_monitorings_unique; Type: INDEX; Schema: public; Owner: -
3d7f0b67
MT
1892--
1893
2913e04e 1894CREATE UNIQUE INDEX release_monitorings_unique ON public.release_monitorings USING btree (distro_id, name) WHERE (deleted_at IS NULL);
3d7f0b67
MT
1895
1896
7e1322ca
MT
1897--
1898-- Name: releases_distro_id; Type: INDEX; Schema: public; Owner: -
1899--
1900
1901CREATE 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
1908CREATE UNIQUE INDEX releases_unique ON public.releases USING btree (slug) WHERE (deleted_at IS NULL);
1909
1910
67fb52de 1911--
ee20e731 1912-- Name: repositories_unique; Type: INDEX; Schema: public; Owner: -
67fb52de 1913--
c660ff59 1914
6dcd5a97 1915CREATE UNIQUE INDEX repositories_unique ON public.repositories USING btree (owner_id, distro_id, slug) WHERE (deleted_at IS NULL);
c660ff59
MT
1916
1917
f87d64a2 1918--
ee20e731 1919-- Name: repository_builds_build_id; Type: INDEX; Schema: public; Owner: -
f87d64a2
MT
1920--
1921
ee20e731
MT
1922CREATE 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
1929CREATE 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
1936CREATE UNIQUE INDEX repository_builds_unique ON public.repository_builds USING btree (repo_id, build_id) WHERE (removed_at IS NULL);
f87d64a2
MT
1937
1938
07c337e7
MT
1939--
1940-- Name: source_commit_jobs_commit_id; Type: INDEX; Schema: public; Owner: -
1941--
1942
1943CREATE INDEX source_commit_jobs_commit_id ON public.source_commit_jobs USING btree (commit_id);
1944
1945
c701b87e
MT
1946--
1947-- Name: source_commits_unique; Type: INDEX; Schema: public; Owner: -
1948--
1949
1950CREATE 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
1957CREATE 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
1964CREATE UNIQUE INDEX sources_slug ON public.sources USING btree (slug) WHERE (deleted_at IS NULL);
1965
1966
bd686a79
MT
1967--
1968-- Name: uploads_builder_id; Type: INDEX; Schema: public; Owner: -
1969--
1970
1971CREATE 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
1978CREATE INDEX uploads_user_id ON public.uploads USING btree (user_id);
1979
1980
fe47bbac 1981--
c734cf6c 1982-- Name: uploads_uuid; Type: INDEX; Schema: public; Owner: -
fe47bbac
MT
1983--
1984
67fb52de 1985CREATE UNIQUE INDEX uploads_uuid ON public.uploads USING btree (uuid);
fe47bbac
MT
1986
1987
d48f75f7
MT
1988--
1989-- Name: user_push_subscriptions_user_id; Type: INDEX; Schema: public; Owner: -
1990--
1991
1992CREATE INDEX user_push_subscriptions_user_id ON public.user_push_subscriptions USING btree (user_id) WHERE (deleted_at IS NULL);
1993
1994
476719e1
MT
1995--
1996-- Name: users_name; Type: INDEX; Schema: public; Owner: -
1997--
1998
1999CREATE UNIQUE INDEX users_name ON public.users USING btree (name) WHERE (deleted_at IS NULL);
2000
2001
b6bc0ea5
MT
2002--
2003-- Name: build_bugs build_bugs_added_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2004--
2005
2006ALTER TABLE ONLY public.build_bugs
8044a2eb 2007 ADD CONSTRAINT build_bugs_added_by FOREIGN KEY (added_by_id) REFERENCES public.users(id);
b6bc0ea5
MT
2008
2009
2010--
2011-- Name: build_bugs build_bugs_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2012--
2013
2014ALTER 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
2022ALTER TABLE ONLY public.build_bugs
8044a2eb 2023 ADD CONSTRAINT build_bugs_removed_by FOREIGN KEY (removed_by_id) REFERENCES public.users(id);
b6bc0ea5
MT
2024
2025
a9a942b5
MT
2026--
2027-- Name: build_groups build_groups_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2028--
2029
2030ALTER TABLE ONLY public.build_groups
dbd5d2a4 2031 ADD CONSTRAINT build_groups_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
a9a942b5
MT
2032
2033
2034--
2035-- Name: build_groups build_groups_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2036--
2037
2038ALTER TABLE ONLY public.build_groups
dbd5d2a4 2039 ADD CONSTRAINT build_groups_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
a9a942b5
MT
2040
2041
a1bc4962
MT
2042--
2043-- Name: build_groups build_groups_tested_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2044--
2045
2046ALTER TABLE ONLY public.build_groups
2047 ADD CONSTRAINT build_groups_tested_build_id FOREIGN KEY (tested_build_id) REFERENCES public.builds(id);
2048
2049
44f74dd6 2050--
c734cf6c 2051-- Name: build_packages build_packages_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
44f74dd6
MT
2052--
2053
2054ALTER TABLE ONLY public.build_packages
2055 ADD CONSTRAINT build_packages_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
2056
2057
2058--
c734cf6c 2059-- Name: build_packages build_packages_job_id; Type: FK CONSTRAINT; Schema: public; Owner: -
44f74dd6
MT
2060--
2061
2062ALTER TABLE ONLY public.build_packages
2063 ADD CONSTRAINT build_packages_job_id FOREIGN KEY (job_id) REFERENCES public.jobs(id);
2064
2065
2066--
c734cf6c 2067-- Name: build_packages build_packages_package_id; Type: FK CONSTRAINT; Schema: public; Owner: -
44f74dd6
MT
2068--
2069
2070ALTER TABLE ONLY public.build_packages
2071 ADD CONSTRAINT build_packages_package_id FOREIGN KEY (package_id) REFERENCES public.packages(id);
2072
2073
100b864f
MT
2074--
2075-- Name: build_points build_points_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2076--
2077
2078ALTER 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
2086ALTER TABLE ONLY public.build_points
2087 ADD CONSTRAINT build_points_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
2088
2089
6c6380e1
MT
2090--
2091-- Name: build_watchers build_watchers_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2092--
2093
2094ALTER 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
2102ALTER TABLE ONLY public.build_watchers
2103 ADD CONSTRAINT build_watchers_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
2104
2105
3a4c6436 2106--
c734cf6c 2107-- Name: builder_stats builder_stats_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: -
3a4c6436
MT
2108--
2109
2110ALTER TABLE ONLY public.builder_stats
2111 ADD CONSTRAINT builder_stats_builder_id FOREIGN KEY (builder_id) REFERENCES public.builders(id);
2112
2113
e844251a
MT
2114--
2115-- Name: builders builders_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2116--
2117
2118ALTER TABLE ONLY public.builders
8044a2eb 2119 ADD CONSTRAINT builders_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
e844251a
MT
2120
2121
2122--
2123-- Name: builders builders_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2124--
2125
2126ALTER TABLE ONLY public.builders
8044a2eb 2127 ADD CONSTRAINT builders_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
e844251a
MT
2128
2129
439d364e 2130--
d0f83268 2131-- Name: build_comments builds_comments_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2132--
2133
d0f83268 2134ALTER TABLE ONLY public.build_comments
64d74848 2135 ADD CONSTRAINT builds_comments_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
439d364e
MT
2136
2137
439d364e 2138--
d0f83268 2139-- Name: build_comments builds_comments_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2140--
2141
d0f83268 2142ALTER TABLE ONLY public.build_comments
64d74848 2143 ADD CONSTRAINT builds_comments_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
439d364e
MT
2144
2145
22c77691
MT
2146--
2147-- Name: builds builds_commit_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2148--
2149
2150ALTER TABLE ONLY public.builds
2151 ADD CONSTRAINT builds_commit_id FOREIGN KEY (commit_id) REFERENCES public.source_commits(id) NOT VALID;
2152
2153
7ff8f45a
MT
2154--
2155-- Name: builds builds_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2156--
2157
2158ALTER TABLE ONLY public.builds
8044a2eb 2159 ADD CONSTRAINT builds_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
7ff8f45a
MT
2160
2161
984b00df
MT
2162--
2163-- Name: builds builds_deprecated_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2164--
2165
2166ALTER TABLE ONLY public.builds
8044a2eb 2167 ADD CONSTRAINT builds_deprecated_by FOREIGN KEY (deprecated_by_id) REFERENCES public.users(id);
29b3094b
MT
2168
2169
2170--
2171-- Name: builds builds_deprecating_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2172--
2173
2174ALTER TABLE ONLY public.builds
2175 ADD CONSTRAINT builds_deprecating_build_id FOREIGN KEY (deprecating_build_id) REFERENCES public.builds(id);
984b00df
MT
2176
2177
f6af9d79
MT
2178--
2179-- Name: builds builds_group_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2180--
2181
2182ALTER TABLE ONLY public.builds
2183 ADD CONSTRAINT builds_group_id FOREIGN KEY (group_id) REFERENCES public.build_groups(id);
2184
2185
439d364e 2186--
c734cf6c 2187-- Name: builds builds_owner_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2188--
2189
67fb52de
MT
2190ALTER TABLE ONLY public.builds
2191 ADD CONSTRAINT builds_owner_id FOREIGN KEY (owner_id) REFERENCES public.users(id);
439d364e
MT
2192
2193
2194--
c734cf6c 2195-- Name: builds builds_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2196--
2197
67fb52de
MT
2198ALTER TABLE ONLY public.builds
2199 ADD CONSTRAINT builds_pkg_id FOREIGN KEY (pkg_id) REFERENCES public.packages(id);
439d364e
MT
2200
2201
e6ae91b3
MT
2202--
2203-- Name: builds builds_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2204--
2205
2206ALTER TABLE ONLY public.builds
2207 ADD CONSTRAINT builds_repo_id FOREIGN KEY (repo_id) REFERENCES public.repositories(id);
2208
2209
03fd7852
MT
2210--
2211-- Name: images images_created_by_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2212--
2213
2214ALTER 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
2222ALTER 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
2230ALTER TABLE ONLY public.images
2231 ADD CONSTRAINT images_release_id FOREIGN KEY (release_id) REFERENCES public.releases(id);
2232
2233
d6105088 2234--
cbcacbc9 2235-- Name: job_packages job_packages_job_id; Type: FK CONSTRAINT; Schema: public; Owner: -
d6105088
MT
2236--
2237
cbcacbc9
MT
2238ALTER TABLE ONLY public.job_packages
2239 ADD CONSTRAINT job_packages_job_id FOREIGN KEY (job_id) REFERENCES public.jobs(id);
d6105088
MT
2240
2241
439d364e 2242--
cbcacbc9 2243-- Name: job_packages job_packages_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2244--
2245
cbcacbc9
MT
2246ALTER TABLE ONLY public.job_packages
2247 ADD CONSTRAINT job_packages_pkg_id FOREIGN KEY (pkg_id) REFERENCES public.packages(id);
439d364e
MT
2248
2249
2250--
cbcacbc9 2251-- Name: jobs jobs_aborted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2252--
2253
67fb52de 2254ALTER TABLE ONLY public.jobs
8044a2eb 2255 ADD CONSTRAINT jobs_aborted_by FOREIGN KEY (aborted_by_id) REFERENCES public.users(id);
439d364e
MT
2256
2257
dfa73e6f 2258--
cbcacbc9 2259-- Name: jobs jobs_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
dfa73e6f
MT
2260--
2261
2262ALTER TABLE ONLY public.jobs
cbcacbc9 2263 ADD CONSTRAINT jobs_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
dfa73e6f
MT
2264
2265
439d364e 2266--
cbcacbc9 2267-- Name: jobs jobs_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2268--
2269
cbcacbc9
MT
2270ALTER TABLE ONLY public.jobs
2271 ADD CONSTRAINT jobs_builder_id FOREIGN KEY (builder_id) REFERENCES public.builders(id);
439d364e
MT
2272
2273
2274--
cbcacbc9 2275-- Name: jobs jobs_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2276--
2277
cbcacbc9
MT
2278ALTER TABLE ONLY public.jobs
2279 ADD CONSTRAINT jobs_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
439d364e
MT
2280
2281
84f143b0 2282--
c734cf6c 2283-- Name: jobs jobs_superseeded_by; Type: FK CONSTRAINT; Schema: public; Owner: -
84f143b0
MT
2284--
2285
67fb52de 2286ALTER TABLE ONLY public.jobs
8044a2eb 2287 ADD CONSTRAINT jobs_superseeded_by FOREIGN KEY (superseeded_by_id) REFERENCES public.jobs(id);
84f143b0
MT
2288
2289
439d364e 2290--
d779a125 2291-- Name: keys keys_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2292--
2293
2cb08e49 2294ALTER TABLE ONLY public.keys
8044a2eb 2295 ADD CONSTRAINT keys_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
d779a125
MT
2296
2297
2298--
2299-- Name: keys keys_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2300--
2301
2302ALTER TABLE ONLY public.keys
8044a2eb 2303 ADD CONSTRAINT keys_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
439d364e
MT
2304
2305
c660ff59 2306--
1523bc41 2307-- Name: mirror_checks mirror_checks_mirror_id; Type: FK CONSTRAINT; Schema: public; Owner: -
c660ff59
MT
2308--
2309
1523bc41
MT
2310ALTER 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
2318ALTER TABLE ONLY public.mirrors
8044a2eb 2319 ADD CONSTRAINT mirrors_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
1523bc41
MT
2320
2321
2322--
2323-- Name: mirrors mirrors_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2324--
2325
2326ALTER TABLE ONLY public.mirrors
8044a2eb 2327 ADD CONSTRAINT mirrors_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
c660ff59
MT
2328
2329
0d66487a
MT
2330--
2331-- Name: package_files package_files_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2332--
2333
2334ALTER TABLE ONLY public.package_files
2335 ADD CONSTRAINT package_files_pkg_id FOREIGN KEY (pkg_id) REFERENCES public.packages(id);
2336
2337
f835411e 2338--
c734cf6c 2339-- Name: packages packages_commit_id; Type: FK CONSTRAINT; Schema: public; Owner: -
f835411e
MT
2340--
2341
67fb52de 2342ALTER TABLE ONLY public.packages
c701b87e 2343 ADD CONSTRAINT packages_commit_id FOREIGN KEY (commit_id) REFERENCES public.source_commits(id);
f835411e
MT
2344
2345
7ad8efc5
MT
2346--
2347-- Name: packages packages_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2348--
2349
2350ALTER TABLE ONLY public.packages
2351 ADD CONSTRAINT packages_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
2352
2353
64991f9f
MT
2354--
2355-- Name: packages packages_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2356--
2357
2358ALTER TABLE ONLY public.packages
2359 ADD CONSTRAINT packages_distro_id FOREIGN KEY (distro_id) REFERENCES public.distributions(id);
2360
2361
7e1322ca
MT
2362--
2363-- Name: release_images release_images_release_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2364--
2365
2366ALTER 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
2374ALTER TABLE ONLY public.release_images
2375 ADD CONSTRAINT release_images_type_id FOREIGN KEY (type_id) REFERENCES public.images_types(id);
2376
2377
d779a125
MT
2378--
2379-- Name: release_monitoring_releases release_monitoring_releases_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2380--
2381
2382ALTER TABLE ONLY public.release_monitoring_releases
2383 ADD CONSTRAINT release_monitoring_releases_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
2384
2385
3d7f0b67 2386--
2913e04e 2387-- Name: release_monitoring_releases release_monitoring_releases_monitoring_id; Type: FK CONSTRAINT; Schema: public; Owner: -
3d7f0b67
MT
2388--
2389
2913e04e
MT
2390ALTER TABLE ONLY public.release_monitoring_releases
2391 ADD CONSTRAINT release_monitoring_releases_monitoring_id FOREIGN KEY (monitoring_id) REFERENCES public.release_monitorings(id);
3d7f0b67
MT
2392
2393
1648678e
MT
2394--
2395-- Name: release_monitoring_releases release_monitoring_releases_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2396--
2397
2398ALTER TABLE ONLY public.release_monitoring_releases
2399 ADD CONSTRAINT release_monitoring_releases_repo_id FOREIGN KEY (repo_id) REFERENCES public.repositories(id);
2400
2401
3d7f0b67 2402--
2913e04e 2403-- Name: release_monitorings release_monitorings_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
3d7f0b67
MT
2404--
2405
2913e04e 2406ALTER TABLE ONLY public.release_monitorings
8044a2eb 2407 ADD CONSTRAINT release_monitorings_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
3d7f0b67
MT
2408
2409
2410--
2913e04e 2411-- Name: release_monitorings release_monitorings_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
3d7f0b67
MT
2412--
2413
2913e04e 2414ALTER TABLE ONLY public.release_monitorings
8044a2eb 2415 ADD CONSTRAINT release_monitorings_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
3d7f0b67
MT
2416
2417
2418--
2913e04e 2419-- Name: release_monitorings release_monitorings_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: -
3d7f0b67
MT
2420--
2421
2913e04e
MT
2422ALTER TABLE ONLY public.release_monitorings
2423 ADD CONSTRAINT release_monitorings_distro_id FOREIGN KEY (distro_id) REFERENCES public.distributions(id);
3d7f0b67
MT
2424
2425
7e1322ca
MT
2426--
2427-- Name: releases releases_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2428--
2429
2430ALTER TABLE ONLY public.releases
8044a2eb 2431 ADD CONSTRAINT releases_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
7e1322ca
MT
2432
2433
2434--
2435-- Name: releases releases_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2436--
2437
2438ALTER TABLE ONLY public.releases
8044a2eb 2439 ADD CONSTRAINT releases_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
7e1322ca
MT
2440
2441
2442--
2443-- Name: releases releases_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2444--
2445
2446ALTER TABLE ONLY public.releases
2447 ADD CONSTRAINT releases_distro_id FOREIGN KEY (distro_id) REFERENCES public.distributions(id);
2448
2449
fe17d32f
MT
2450--
2451-- Name: repositories repositories_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2452--
2453
2454ALTER TABLE ONLY public.repositories
2455 ADD CONSTRAINT repositories_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
2456
2457
439d364e 2458--
c734cf6c 2459-- Name: repositories repositories_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2460--
2461
67fb52de
MT
2462ALTER TABLE ONLY public.repositories
2463 ADD CONSTRAINT repositories_distro_id FOREIGN KEY (distro_id) REFERENCES public.distributions(id);
439d364e
MT
2464
2465
439d364e 2466--
c734cf6c 2467-- Name: repositories repositories_key_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2468--
2469
67fb52de
MT
2470ALTER TABLE ONLY public.repositories
2471 ADD CONSTRAINT repositories_key_id FOREIGN KEY (key_id) REFERENCES public.keys(id);
439d364e
MT
2472
2473
2474--
c734cf6c 2475-- Name: repositories repositories_owner_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2476--
2477
67fb52de 2478ALTER TABLE ONLY public.repositories
f87d64a2 2479 ADD CONSTRAINT repositories_owner_id FOREIGN KEY (owner_id) REFERENCES public.users(id);
439d364e
MT
2480
2481
ee20e731
MT
2482--
2483-- Name: repository_builds repository_builds_added_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2484--
2485
2486ALTER TABLE ONLY public.repository_builds
8044a2eb 2487 ADD CONSTRAINT repository_builds_added_by FOREIGN KEY (added_by_id) REFERENCES public.users(id);
ee20e731
MT
2488
2489
2490--
2491-- Name: repository_builds repository_builds_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2492--
2493
2494ALTER 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
2502ALTER TABLE ONLY public.repository_builds
8044a2eb 2503 ADD CONSTRAINT repository_builds_removed_by FOREIGN KEY (removed_by_id) REFERENCES public.users(id);
ee20e731
MT
2504
2505
2506--
2507-- Name: repository_builds repository_builds_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2508--
2509
2510ALTER TABLE ONLY public.repository_builds
2511 ADD CONSTRAINT repository_builds_repo_id FOREIGN KEY (repo_id) REFERENCES public.repositories(id);
2512
2513
439d364e 2514--
c734cf6c 2515-- Name: sessions sessions_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2516--
2517
67fb52de
MT
2518ALTER TABLE ONLY public.sessions
2519 ADD CONSTRAINT sessions_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
439d364e
MT
2520
2521
07c337e7
MT
2522--
2523-- Name: source_commit_jobs source_commit_jobs_commit_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2524--
2525
2526ALTER 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
2534ALTER 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
439d364e 2538--
c701b87e 2539-- Name: source_commits sources_commits_source_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2540--
2541
c701b87e 2542ALTER TABLE ONLY public.source_commits
67fb52de 2543 ADD CONSTRAINT sources_commits_source_id FOREIGN KEY (source_id) REFERENCES public.sources(id);
439d364e
MT
2544
2545
2546--
c701b87e
MT
2547-- Name: sources sources_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2548--
2549
2550ALTER TABLE ONLY public.sources
8044a2eb 2551 ADD CONSTRAINT sources_created_by FOREIGN KEY (created_by_id) REFERENCES public.users(id);
c701b87e
MT
2552
2553
2554--
2555-- Name: sources sources_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2556--
2557
2558ALTER TABLE ONLY public.sources
8044a2eb 2559 ADD CONSTRAINT sources_deleted_by FOREIGN KEY (deleted_by_id) REFERENCES public.users(id);
c701b87e
MT
2560
2561
2562--
2563-- Name: sources sources_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2564--
2565
67fb52de 2566ALTER TABLE ONLY public.sources
c701b87e 2567 ADD CONSTRAINT sources_repo_id FOREIGN KEY (repo_id) REFERENCES public.repositories(id);
439d364e
MT
2568
2569
2570--
c734cf6c 2571-- Name: uploads uploads_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2572--
2573
67fb52de
MT
2574ALTER TABLE ONLY public.uploads
2575 ADD CONSTRAINT uploads_builder_id FOREIGN KEY (builder_id) REFERENCES public.builders(id);
439d364e
MT
2576
2577
2578--
c734cf6c 2579-- Name: uploads uploads_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2580--
2581
67fb52de
MT
2582ALTER TABLE ONLY public.uploads
2583 ADD CONSTRAINT uploads_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
439d364e
MT
2584
2585
d48f75f7
MT
2586--
2587-- Name: user_push_subscriptions user_push_subscriptions_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2588--
2589
2590ALTER TABLE ONLY public.user_push_subscriptions
2591 ADD CONSTRAINT user_push_subscriptions_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
2592
2593
b1491f00
MT
2594--
2595-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: -
2596--
2597
2598REVOKE USAGE ON SCHEMA public FROM PUBLIC;
2599GRANT ALL ON SCHEMA public TO PUBLIC;
2600
2601
64316541
MT
2602--
2603-- PostgreSQL database dump complete
2604--
9050c160 2605