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