]> git.ipfire.org Git - pbs.git/blame - src/database.sql
db: Fix remaining index names
[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,
09d78b55 1123 quota bigint,
857a7836 1124 perms text[] DEFAULT ARRAY[]::text[] NOT NULL,
c8550381
MT
1125 _attrs bytea,
1126 bugzilla_api_key text
64316541
MT
1127);
1128
1129
64316541 1130--
c734cf6c 1131-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
64316541
MT
1132--
1133
67fb52de 1134CREATE SEQUENCE public.users_id_seq
64316541
MT
1135 START WITH 1
1136 INCREMENT BY 1
1137 NO MINVALUE
1138 NO MAXVALUE
1139 CACHE 1;
1140
1141
64316541 1142--
c734cf6c 1143-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
64316541
MT
1144--
1145
67fb52de 1146ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
64316541
MT
1147
1148
b6bc0ea5
MT
1149--
1150-- Name: build_bugs id; Type: DEFAULT; Schema: public; Owner: -
1151--
1152
1153ALTER TABLE ONLY public.build_bugs ALTER COLUMN id SET DEFAULT nextval('public.build_bugs_id_seq'::regclass);
1154
1155
d0f83268
MT
1156--
1157-- Name: build_comments id; Type: DEFAULT; Schema: public; Owner: -
1158--
1159
1160ALTER TABLE ONLY public.build_comments ALTER COLUMN id SET DEFAULT nextval('public.builds_comments_id_seq'::regclass);
1161
1162
668846ac
MT
1163--
1164-- Name: build_groups id; Type: DEFAULT; Schema: public; Owner: -
1165--
1166
1167ALTER TABLE ONLY public.build_groups ALTER COLUMN id SET DEFAULT nextval('public.build_groups_id_seq'::regclass);
1168
1169
64316541 1170--
c734cf6c 1171-- Name: builders id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1172--
1173
67fb52de 1174ALTER TABLE ONLY public.builders ALTER COLUMN id SET DEFAULT nextval('public.builders_id_seq'::regclass);
64316541
MT
1175
1176
64316541 1177--
c734cf6c 1178-- Name: builds id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1179--
1180
67fb52de 1181ALTER TABLE ONLY public.builds ALTER COLUMN id SET DEFAULT nextval('public.builds_id_seq'::regclass);
64316541
MT
1182
1183
64316541 1184--
c734cf6c 1185-- Name: distributions id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1186--
1187
67fb52de 1188ALTER TABLE ONLY public.distributions ALTER COLUMN id SET DEFAULT nextval('public.distributions_id_seq'::regclass);
64316541
MT
1189
1190
64316541 1191--
c734cf6c 1192-- Name: images_types id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1193--
1194
67fb52de 1195ALTER TABLE ONLY public.images_types ALTER COLUMN id SET DEFAULT nextval('public.images_types_id_seq'::regclass);
64316541
MT
1196
1197
1198--
c734cf6c 1199-- Name: jobs id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1200--
1201
67fb52de 1202ALTER TABLE ONLY public.jobs ALTER COLUMN id SET DEFAULT nextval('public.jobs_id_seq'::regclass);
64316541
MT
1203
1204
64316541 1205--
c734cf6c 1206-- Name: keys id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1207--
1208
67fb52de 1209ALTER TABLE ONLY public.keys ALTER COLUMN id SET DEFAULT nextval('public.keys_id_seq'::regclass);
64316541
MT
1210
1211
68dd077d 1212--
c734cf6c 1213-- Name: messages id; Type: DEFAULT; Schema: public; Owner: -
68dd077d
MT
1214--
1215
67fb52de 1216ALTER TABLE ONLY public.messages ALTER COLUMN id SET DEFAULT nextval('public.messages_id_seq'::regclass);
68dd077d
MT
1217
1218
64316541 1219--
c734cf6c 1220-- Name: mirrors id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1221--
1222
67fb52de 1223ALTER TABLE ONLY public.mirrors ALTER COLUMN id SET DEFAULT nextval('public.mirrors_id_seq'::regclass);
64316541
MT
1224
1225
64316541 1226--
c734cf6c 1227-- Name: packages id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1228--
1229
67fb52de 1230ALTER TABLE ONLY public.packages ALTER COLUMN id SET DEFAULT nextval('public.packages_id_seq'::regclass);
64316541
MT
1231
1232
7e1322ca
MT
1233--
1234-- Name: release_images id; Type: DEFAULT; Schema: public; Owner: -
1235--
1236
1237ALTER TABLE ONLY public.release_images ALTER COLUMN id SET DEFAULT nextval('public.release_images_id_seq'::regclass);
1238
1239
3d7f0b67 1240--
2913e04e 1241-- Name: release_monitoring_releases id; Type: DEFAULT; Schema: public; Owner: -
3d7f0b67
MT
1242--
1243
2913e04e 1244ALTER TABLE ONLY public.release_monitoring_releases ALTER COLUMN id SET DEFAULT nextval('public.release_monitoring_releases_id_seq'::regclass);
3d7f0b67
MT
1245
1246
1247--
2913e04e 1248-- Name: release_monitorings id; Type: DEFAULT; Schema: public; Owner: -
3d7f0b67
MT
1249--
1250
2913e04e 1251ALTER TABLE ONLY public.release_monitorings ALTER COLUMN id SET DEFAULT nextval('public.release_monitorings_id_seq'::regclass);
3d7f0b67
MT
1252
1253
7e1322ca
MT
1254--
1255-- Name: releases id; Type: DEFAULT; Schema: public; Owner: -
1256--
1257
1258ALTER TABLE ONLY public.releases ALTER COLUMN id SET DEFAULT nextval('public.releases_id_seq'::regclass);
1259
1260
64316541 1261--
c734cf6c 1262-- Name: repositories id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1263--
1264
67fb52de 1265ALTER TABLE ONLY public.repositories ALTER COLUMN id SET DEFAULT nextval('public.repositories_id_seq'::regclass);
64316541
MT
1266
1267
64316541 1268--
ee20e731 1269-- Name: repository_builds id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1270--
1271
ee20e731 1272ALTER TABLE ONLY public.repository_builds ALTER COLUMN id SET DEFAULT nextval('public.repository_builds_id_seq'::regclass);
64316541
MT
1273
1274
d2738057 1275--
c734cf6c 1276-- Name: sessions id; Type: DEFAULT; Schema: public; Owner: -
d2738057
MT
1277--
1278
67fb52de 1279ALTER TABLE ONLY public.sessions ALTER COLUMN id SET DEFAULT nextval('public.sessions_id_seq'::regclass);
d2738057
MT
1280
1281
07c337e7
MT
1282--
1283-- Name: source_commit_jobs id; Type: DEFAULT; Schema: public; Owner: -
1284--
1285
1286ALTER TABLE ONLY public.source_commit_jobs ALTER COLUMN id SET DEFAULT nextval('public.source_commit_jobs_id_seq'::regclass);
1287
1288
64316541 1289--
c701b87e 1290-- Name: source_commits id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1291--
1292
07c337e7 1293ALTER TABLE ONLY public.source_commits ALTER COLUMN id SET DEFAULT nextval('public.source_commits_id_seq'::regclass);
64316541
MT
1294
1295
1296--
c701b87e 1297-- Name: sources id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1298--
1299
c701b87e 1300ALTER TABLE ONLY public.sources ALTER COLUMN id SET DEFAULT nextval('public.sources_id_seq'::regclass);
64316541
MT
1301
1302
1303--
c734cf6c 1304-- Name: uploads id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1305--
1306
67fb52de 1307ALTER TABLE ONLY public.uploads ALTER COLUMN id SET DEFAULT nextval('public.uploads_id_seq'::regclass);
64316541
MT
1308
1309
d48f75f7
MT
1310--
1311-- Name: user_push_subscriptions id; Type: DEFAULT; Schema: public; Owner: -
1312--
1313
1314ALTER TABLE ONLY public.user_push_subscriptions ALTER COLUMN id SET DEFAULT nextval('public.user_push_subscriptions_id_seq'::regclass);
1315
1316
64316541 1317--
c734cf6c 1318-- Name: users id; Type: DEFAULT; Schema: public; Owner: -
64316541
MT
1319--
1320
67fb52de 1321ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
64316541
MT
1322
1323
b6bc0ea5
MT
1324--
1325-- Name: build_bugs build_bugs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1326--
1327
1328ALTER TABLE ONLY public.build_bugs
1329 ADD CONSTRAINT build_bugs_pkey PRIMARY KEY (id);
1330
1331
d0f83268
MT
1332--
1333-- Name: build_comments build_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1334--
1335
1336ALTER TABLE ONLY public.build_comments
1337 ADD CONSTRAINT build_comments_pkey PRIMARY KEY (id);
1338
1339
668846ac
MT
1340--
1341-- Name: build_groups build_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1342--
1343
1344ALTER TABLE ONLY public.build_groups
1345 ADD CONSTRAINT build_groups_pkey PRIMARY KEY (id);
1346
1347
44f74dd6 1348--
c734cf6c 1349-- Name: builds builds_pkey; Type: CONSTRAINT; Schema: public; Owner: -
44f74dd6
MT
1350--
1351
1352ALTER TABLE ONLY public.builds
1353 ADD CONSTRAINT builds_pkey PRIMARY KEY (id);
1354
1355
7ed93a91 1356--
c734cf6c 1357-- Name: distributions distributions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
7ed93a91
MT
1358--
1359
1360ALTER TABLE ONLY public.distributions
1361 ADD CONSTRAINT distributions_pkey PRIMARY KEY (id);
1362
1363
64316541 1364--
c734cf6c 1365-- Name: builders idx_2197954_primary; Type: CONSTRAINT; Schema: public; Owner: -
64316541
MT
1366--
1367
67fb52de 1368ALTER TABLE ONLY public.builders
64316541
MT
1369 ADD CONSTRAINT idx_2197954_primary PRIMARY KEY (id);
1370
1371
64316541 1372--
ad1545f1 1373-- Name: images_types image_types_pkey; Type: CONSTRAINT; Schema: public; Owner: -
64316541
MT
1374--
1375
67fb52de 1376ALTER TABLE ONLY public.images_types
ad1545f1 1377 ADD CONSTRAINT image_types_pkey PRIMARY KEY (id);
64316541
MT
1378
1379
02de33ff 1380--
c734cf6c 1381-- Name: jobs jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
02de33ff
MT
1382--
1383
1384ALTER TABLE ONLY public.jobs
1385 ADD CONSTRAINT jobs_pkey PRIMARY KEY (id);
1386
1387
2cb08e49 1388--
c734cf6c 1389-- Name: keys keys_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2cb08e49
MT
1390--
1391
1392ALTER TABLE ONLY public.keys
1393 ADD CONSTRAINT keys_pkey PRIMARY KEY (id);
1394
1395
c58cb031
MT
1396--
1397-- Name: messages messages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1398--
1399
1400ALTER TABLE ONLY public.messages
1401 ADD CONSTRAINT messages_pkey PRIMARY KEY (id);
1402
1403
c660ff59 1404--
1523bc41 1405-- Name: mirrors mirrors_pkey; Type: CONSTRAINT; Schema: public; Owner: -
c660ff59
MT
1406--
1407
1523bc41
MT
1408ALTER TABLE ONLY public.mirrors
1409 ADD CONSTRAINT mirrors_pkey PRIMARY KEY (id);
c660ff59
MT
1410
1411
650791fb 1412--
c734cf6c 1413-- Name: packages packages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
650791fb
MT
1414--
1415
1416ALTER TABLE ONLY public.packages
1417 ADD CONSTRAINT packages_pkey PRIMARY KEY (id);
1418
1419
7e1322ca
MT
1420--
1421-- Name: release_images release_images_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1422--
1423
1424ALTER TABLE ONLY public.release_images
1425 ADD CONSTRAINT release_images_pkey PRIMARY KEY (id);
1426
1427
3d7f0b67 1428--
2913e04e 1429-- Name: release_monitoring_releases release_monitoring_releases_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3d7f0b67
MT
1430--
1431
2913e04e
MT
1432ALTER TABLE ONLY public.release_monitoring_releases
1433 ADD CONSTRAINT release_monitoring_releases_pkey PRIMARY KEY (id);
3d7f0b67
MT
1434
1435
1436--
2913e04e 1437-- Name: release_monitorings release_monitorings_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3d7f0b67
MT
1438--
1439
2913e04e
MT
1440ALTER TABLE ONLY public.release_monitorings
1441 ADD CONSTRAINT release_monitorings_pkey PRIMARY KEY (id);
3d7f0b67
MT
1442
1443
7e1322ca
MT
1444--
1445-- Name: releases releases_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1446--
1447
1448ALTER TABLE ONLY public.releases
1449 ADD CONSTRAINT releases_pkey PRIMARY KEY (id);
1450
1451
29fb7c98 1452--
ee20e731 1453-- Name: repositories repositories_pkey; Type: CONSTRAINT; Schema: public; Owner: -
29fb7c98
MT
1454--
1455
ee20e731
MT
1456ALTER TABLE ONLY public.repositories
1457 ADD CONSTRAINT repositories_pkey PRIMARY KEY (id);
29fb7c98
MT
1458
1459
f87d64a2 1460--
ee20e731 1461-- Name: repository_builds repository_builds_pkey; Type: CONSTRAINT; Schema: public; Owner: -
f87d64a2
MT
1462--
1463
ee20e731
MT
1464ALTER TABLE ONLY public.repository_builds
1465 ADD CONSTRAINT repository_builds_pkey PRIMARY KEY (id);
f87d64a2
MT
1466
1467
d2738057 1468--
c734cf6c 1469-- Name: sessions sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
d2738057
MT
1470--
1471
67fb52de 1472ALTER TABLE ONLY public.sessions
d2738057
MT
1473 ADD CONSTRAINT sessions_pkey PRIMARY KEY (id);
1474
1475
1476--
c734cf6c 1477-- Name: sessions sessions_session_id_key; Type: CONSTRAINT; Schema: public; Owner: -
d2738057
MT
1478--
1479
67fb52de 1480ALTER TABLE ONLY public.sessions
d2738057
MT
1481 ADD CONSTRAINT sessions_session_id_key UNIQUE (session_id);
1482
1483
07c337e7
MT
1484--
1485-- Name: source_commit_jobs source_commit_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1486--
1487
1488ALTER TABLE ONLY public.source_commit_jobs
1489 ADD CONSTRAINT source_commit_jobs_pkey PRIMARY KEY (id);
1490
1491
c701b87e
MT
1492--
1493-- Name: source_commits source_commits_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1494--
1495
1496ALTER TABLE ONLY public.source_commits
1497 ADD CONSTRAINT source_commits_pkey PRIMARY KEY (id);
1498
1499
1500--
1501-- Name: sources sources_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1502--
1503
1504ALTER TABLE ONLY public.sources
1505 ADD CONSTRAINT sources_pkey PRIMARY KEY (id);
1506
1507
8b4010c2 1508--
c734cf6c 1509-- Name: uploads uploads_id; Type: CONSTRAINT; Schema: public; Owner: -
8b4010c2
MT
1510--
1511
67fb52de
MT
1512ALTER TABLE ONLY public.uploads
1513 ADD CONSTRAINT uploads_id PRIMARY KEY (id);
8b4010c2
MT
1514
1515
d48f75f7
MT
1516--
1517-- Name: user_push_subscriptions user_push_subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1518--
1519
1520ALTER TABLE ONLY public.user_push_subscriptions
1521 ADD CONSTRAINT user_push_subscriptions_pkey PRIMARY KEY (id);
1522
1523
476719e1
MT
1524--
1525-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1526--
1527
1528ALTER TABLE ONLY public.users
1529 ADD CONSTRAINT users_pkey PRIMARY KEY (id);
1530
1531
b6bc0ea5
MT
1532--
1533-- Name: build_bugs_unique; Type: INDEX; Schema: public; Owner: -
1534--
1535
1536CREATE UNIQUE INDEX build_bugs_unique ON public.build_bugs USING btree (build_id, bug_id) WHERE (removed_at IS NULL);
1537
1538
d0f83268
MT
1539--
1540-- Name: build_comments_build_id; Type: INDEX; Schema: public; Owner: -
1541--
1542
1543CREATE INDEX build_comments_build_id ON public.build_comments USING btree (build_id) WHERE (deleted IS FALSE);
1544
1545
1546--
1547-- Name: build_comments_created_at; Type: INDEX; Schema: public; Owner: -
1548--
1549
1550CREATE INDEX build_comments_created_at ON public.build_comments USING btree (created_at) WHERE (deleted IS FALSE);
1551
1552
1553--
1554-- Name: build_comments_user_id; Type: INDEX; Schema: public; Owner: -
1555--
1556
1557CREATE INDEX build_comments_user_id ON public.build_comments USING btree (user_id) WHERE (deleted IS FALSE);
1558
1559
668846ac
MT
1560--
1561-- Name: build_groups_uuid; Type: INDEX; Schema: public; Owner: -
1562--
1563
a9a942b5 1564CREATE UNIQUE INDEX build_groups_uuid ON public.build_groups USING btree (uuid) WHERE (deleted_at IS NULL);
668846ac
MT
1565
1566
e704b8e2 1567--
c734cf6c 1568-- Name: build_packages_build_id; Type: INDEX; Schema: public; Owner: -
e704b8e2
MT
1569--
1570
44f74dd6 1571CREATE INDEX build_packages_build_id ON public.build_packages USING btree (build_id);
439d364e
MT
1572
1573
100b864f
MT
1574--
1575-- Name: build_points_build_id; Type: INDEX; Schema: public; Owner: -
1576--
1577
1578CREATE INDEX build_points_build_id ON public.build_points USING btree (build_id);
1579
1580
6c6380e1
MT
1581--
1582-- Name: build_watchers_unique; Type: INDEX; Schema: public; Owner: -
1583--
1584
1585CREATE UNIQUE INDEX build_watchers_unique ON public.build_watchers USING btree (build_id, user_id) WHERE (deleted_at IS NULL);
1586
1587
e459cbba 1588--
c734cf6c 1589-- Name: builders_name; Type: INDEX; Schema: public; Owner: -
e459cbba
MT
1590--
1591
e844251a 1592CREATE UNIQUE INDEX builders_name ON public.builders USING btree (name) WHERE (deleted_at IS NULL);
e459cbba
MT
1593
1594
668846ac
MT
1595--
1596-- Name: builds_build_group_id; Type: INDEX; Schema: public; Owner: -
1597--
1598
1599CREATE INDEX builds_build_group_id ON public.builds USING btree (build_group_id) WHERE (deleted_at IS NULL);
1600
1601
64316541 1602--
c734cf6c 1603-- Name: builds_created_at; Type: INDEX; Schema: public; Owner: -
64316541
MT
1604--
1605
7ff8f45a 1606CREATE INDEX builds_created_at ON public.builds USING btree (created_at DESC) WHERE (deleted_at IS NULL);
64316541
MT
1607
1608
b6463980
MT
1609--
1610-- Name: builds_deleted; Type: INDEX; Schema: public; Owner: -
1611--
1612
1613CREATE INDEX builds_deleted ON public.builds USING btree (deleted_at) WHERE (deleted_at IS NOT NULL);
1614
1615
984b00df 1616--
29b3094b 1617-- Name: builds_deprecating_build_id; Type: INDEX; Schema: public; Owner: -
984b00df
MT
1618--
1619
29b3094b 1620CREATE 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
1621
1622
5f08ee36
MT
1623--
1624-- Name: builds_not_tests; Type: INDEX; Schema: public; Owner: -
1625--
1626
1627CREATE UNIQUE INDEX builds_not_tests ON public.builds USING btree (id) WHERE ((test IS FALSE) AND (deleted_at IS NULL));
1628
1629
8066bbf3 1630--
c734cf6c 1631-- Name: builds_pkg_id; Type: INDEX; Schema: public; Owner: -
8066bbf3
MT
1632--
1633
7ff8f45a 1634CREATE INDEX builds_pkg_id ON public.builds USING btree (pkg_id) WHERE (deleted_at IS NULL);
8066bbf3
MT
1635
1636
68180d16
MT
1637--
1638-- Name: builds_scratch_builds; Type: INDEX; Schema: public; Owner: -
1639--
1640
1641CREATE UNIQUE INDEX builds_scratch_builds ON public.builds USING btree (id) WHERE ((deleted_at IS NULL) AND (owner_id IS NOT NULL));
1642
1643
64316541 1644--
c734cf6c 1645-- Name: builds_uuid; Type: INDEX; Schema: public; Owner: -
64316541
MT
1646--
1647
7ff8f45a 1648CREATE UNIQUE INDEX builds_uuid ON public.builds USING btree (uuid) WHERE (deleted_at IS NULL);
64316541
MT
1649
1650
64316541 1651--
dad4414b 1652-- Name: distributions_unique; Type: INDEX; Schema: public; Owner: -
64316541
MT
1653--
1654
dad4414b 1655CREATE UNIQUE INDEX distributions_unique ON public.distributions USING btree (distro_id, version_id) WHERE (deleted IS FALSE);
64316541
MT
1656
1657
cbcacbc9
MT
1658--
1659-- Name: job_packages_job_id; Type: INDEX; Schema: public; Owner: -
1660--
1661
1662CREATE INDEX job_packages_job_id ON public.job_packages USING btree (job_id);
1663
1664
1665--
1666-- Name: job_packages_pkg_id; Type: INDEX; Schema: public; Owner: -
1667--
1668
1669CREATE UNIQUE INDEX job_packages_pkg_id ON public.job_packages USING btree (pkg_id);
1670
1671
3d743a8e 1672--
c734cf6c 1673-- Name: jobs_arch; Type: INDEX; Schema: public; Owner: -
3d743a8e
MT
1674--
1675
67fb52de 1676CREATE INDEX jobs_arch ON public.jobs USING btree (arch);
3d743a8e
MT
1677
1678
0a0d8db7 1679--
c734cf6c 1680-- Name: jobs_build_id; Type: INDEX; Schema: public; Owner: -
0a0d8db7
MT
1681--
1682
dfa73e6f 1683CREATE INDEX jobs_build_id ON public.jobs USING btree (build_id) WHERE (deleted_at IS NULL);
0a0d8db7
MT
1684
1685
e0e14322 1686--
c734cf6c 1687-- Name: jobs_finished_at; Type: INDEX; Schema: public; Owner: -
02de33ff
MT
1688--
1689
1690CREATE INDEX jobs_finished_at ON public.jobs USING btree (finished_at DESC) WHERE (finished_at IS NOT NULL);
1691
1692
1693--
c734cf6c 1694-- Name: jobs_pending; Type: INDEX; Schema: public; Owner: -
e0e14322
MT
1695--
1696
a08f4acc 1697CREATE 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
1698
1699
1b1f4a37 1700--
c734cf6c 1701-- Name: jobs_running; Type: INDEX; Schema: public; Owner: -
1b1f4a37
MT
1702--
1703
9689a8c3 1704CREATE 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
1705
1706
581c1ead
MT
1707--
1708-- Name: jobs_superseeded_by; Type: INDEX; Schema: public; Owner: -
1709--
1710
1711CREATE INDEX jobs_superseeded_by ON public.jobs USING btree (superseeded_by);
1712
1713
de667c37 1714--
c734cf6c 1715-- Name: jobs_uuid; Type: INDEX; Schema: public; Owner: -
de667c37
MT
1716--
1717
dfa73e6f 1718CREATE UNIQUE INDEX jobs_uuid ON public.jobs USING btree (uuid) WHERE (deleted_at IS NULL);
de667c37
MT
1719
1720
68dd077d 1721--
c58cb031 1722-- Name: messages_queued; Type: INDEX; Schema: public; Owner: -
68dd077d
MT
1723--
1724
c58cb031 1725CREATE INDEX messages_queued ON public.messages USING btree (priority DESC, queued_at) WHERE (sent_at IS NULL);
68dd077d
MT
1726
1727
c660ff59 1728--
1523bc41 1729-- Name: mirror_checks_search; Type: INDEX; Schema: public; Owner: -
c660ff59
MT
1730--
1731
1523bc41
MT
1732CREATE INDEX mirror_checks_search ON public.mirror_checks USING btree (mirror_id, checked_at);
1733
1734
1735--
1736-- Name: mirrors_hostname; Type: INDEX; Schema: public; Owner: -
1737--
67fb52de 1738
1523bc41 1739CREATE UNIQUE INDEX mirrors_hostname ON public.mirrors USING btree (hostname) WHERE (deleted_at IS NULL);
67fb52de
MT
1740
1741
0d66487a
MT
1742--
1743-- Name: package_files_path; Type: INDEX; Schema: public; Owner: -
1744--
1745
1746CREATE INDEX package_files_path ON public.package_files USING btree (path);
1747
1748
1749--
1750-- Name: package_files_pkg_id; Type: INDEX; Schema: public; Owner: -
1751--
1752
1753CREATE INDEX package_files_pkg_id ON public.package_files USING btree (pkg_id);
1754
1755
091eb763 1756--
5f08ee36 1757-- Name: packages_name; Type: INDEX; Schema: public; Owner: -
091eb763
MT
1758--
1759
5f08ee36 1760CREATE INDEX packages_name ON public.packages USING btree (name);
091eb763
MT
1761
1762
650791fb 1763--
5f08ee36 1764-- Name: packages_search; Type: INDEX; Schema: public; Owner: -
650791fb
MT
1765--
1766
5f08ee36 1767CREATE INDEX packages_search ON public.packages USING gin (_search) WHERE (deleted_at IS NULL);
650791fb
MT
1768
1769
d779a125
MT
1770--
1771-- Name: release_monitoring_releases_build_id; Type: INDEX; Schema: public; Owner: -
1772--
1773
1774CREATE INDEX release_monitoring_releases_build_id ON public.release_monitoring_releases USING btree (build_id);
1775
1776
3d7f0b67 1777--
2913e04e 1778-- Name: release_monitoring_releases_search; Type: INDEX; Schema: public; Owner: -
3d7f0b67
MT
1779--
1780
2913e04e 1781CREATE INDEX release_monitoring_releases_search ON public.release_monitoring_releases USING btree (monitoring_id, created_at);
3d7f0b67
MT
1782
1783
1784--
2913e04e 1785-- Name: release_monitoring_releases_unique; Type: INDEX; Schema: public; Owner: -
3d7f0b67
MT
1786--
1787
2913e04e 1788CREATE UNIQUE INDEX release_monitoring_releases_unique ON public.release_monitoring_releases USING btree (monitoring_id, version);
3d7f0b67
MT
1789
1790
1791--
2913e04e 1792-- Name: release_monitorings_unique; Type: INDEX; Schema: public; Owner: -
3d7f0b67
MT
1793--
1794
2913e04e 1795CREATE UNIQUE INDEX release_monitorings_unique ON public.release_monitorings USING btree (distro_id, name) WHERE (deleted_at IS NULL);
3d7f0b67
MT
1796
1797
7e1322ca
MT
1798--
1799-- Name: releases_distro_id; Type: INDEX; Schema: public; Owner: -
1800--
1801
1802CREATE INDEX releases_distro_id ON public.releases USING btree (distro_id) WHERE (deleted_at IS NULL);
1803
1804
1805--
1806-- Name: releases_unique; Type: INDEX; Schema: public; Owner: -
1807--
1808
1809CREATE UNIQUE INDEX releases_unique ON public.releases USING btree (slug) WHERE (deleted_at IS NULL);
1810
1811
67fb52de 1812--
ee20e731 1813-- Name: repositories_unique; Type: INDEX; Schema: public; Owner: -
67fb52de 1814--
c660ff59 1815
6dcd5a97 1816CREATE UNIQUE INDEX repositories_unique ON public.repositories USING btree (owner_id, distro_id, slug) WHERE (deleted_at IS NULL);
c660ff59
MT
1817
1818
f87d64a2 1819--
ee20e731 1820-- Name: repository_builds_build_id; Type: INDEX; Schema: public; Owner: -
f87d64a2
MT
1821--
1822
ee20e731
MT
1823CREATE INDEX repository_builds_build_id ON public.repository_builds USING btree (build_id);
1824
1825
1826--
1827-- Name: repository_builds_repo_id; Type: INDEX; Schema: public; Owner: -
1828--
1829
1830CREATE INDEX repository_builds_repo_id ON public.repository_builds USING btree (repo_id) WHERE (removed_at IS NULL);
1831
1832
1833--
1834-- Name: repository_builds_unique; Type: INDEX; Schema: public; Owner: -
1835--
1836
1837CREATE UNIQUE INDEX repository_builds_unique ON public.repository_builds USING btree (repo_id, build_id) WHERE (removed_at IS NULL);
f87d64a2
MT
1838
1839
ad1545f1
MT
1840--
1841-- Name: settings_k; Type: INDEX; Schema: public; Owner: -
1842--
1843
1844CREATE UNIQUE INDEX settings_k ON public.settings USING btree (k);
1845
1846
07c337e7
MT
1847--
1848-- Name: source_commit_jobs_commit_id; Type: INDEX; Schema: public; Owner: -
1849--
1850
1851CREATE INDEX source_commit_jobs_commit_id ON public.source_commit_jobs USING btree (commit_id);
1852
1853
c701b87e
MT
1854--
1855-- Name: source_commits_unique; Type: INDEX; Schema: public; Owner: -
1856--
1857
1858CREATE UNIQUE INDEX source_commits_unique ON public.source_commits USING btree (source_id, revision);
1859
1860
1861--
1862-- Name: sources_repo_id; Type: INDEX; Schema: public; Owner: -
1863--
1864
1865CREATE INDEX sources_repo_id ON public.sources USING btree (repo_id) WHERE (deleted_at IS NULL);
1866
1867
1868--
1869-- Name: sources_slug; Type: INDEX; Schema: public; Owner: -
1870--
1871
1872CREATE UNIQUE INDEX sources_slug ON public.sources USING btree (slug) WHERE (deleted_at IS NULL);
1873
1874
fe47bbac 1875--
c734cf6c 1876-- Name: uploads_uuid; Type: INDEX; Schema: public; Owner: -
fe47bbac
MT
1877--
1878
67fb52de 1879CREATE UNIQUE INDEX uploads_uuid ON public.uploads USING btree (uuid);
fe47bbac
MT
1880
1881
d48f75f7
MT
1882--
1883-- Name: user_push_subscriptions_user_id; Type: INDEX; Schema: public; Owner: -
1884--
1885
1886CREATE INDEX user_push_subscriptions_user_id ON public.user_push_subscriptions USING btree (user_id) WHERE (deleted_at IS NULL);
1887
1888
476719e1
MT
1889--
1890-- Name: users_name; Type: INDEX; Schema: public; Owner: -
1891--
1892
1893CREATE UNIQUE INDEX users_name ON public.users USING btree (name) WHERE (deleted_at IS NULL);
1894
1895
b6bc0ea5
MT
1896--
1897-- Name: build_bugs build_bugs_added_by; Type: FK CONSTRAINT; Schema: public; Owner: -
1898--
1899
1900ALTER TABLE ONLY public.build_bugs
1901 ADD CONSTRAINT build_bugs_added_by FOREIGN KEY (added_by) REFERENCES public.users(id);
1902
1903
1904--
1905-- Name: build_bugs build_bugs_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
1906--
1907
1908ALTER TABLE ONLY public.build_bugs
1909 ADD CONSTRAINT build_bugs_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
1910
1911
1912--
1913-- Name: build_bugs build_bugs_removed_by; Type: FK CONSTRAINT; Schema: public; Owner: -
1914--
1915
1916ALTER TABLE ONLY public.build_bugs
1917 ADD CONSTRAINT build_bugs_removed_by FOREIGN KEY (removed_by) REFERENCES public.users(id);
1918
1919
a9a942b5
MT
1920--
1921-- Name: build_groups build_groups_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
1922--
1923
1924ALTER TABLE ONLY public.build_groups
1925 ADD CONSTRAINT build_groups_created_by FOREIGN KEY (created_by) REFERENCES public.users(id);
1926
1927
1928--
1929-- Name: build_groups build_groups_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
1930--
1931
1932ALTER TABLE ONLY public.build_groups
1933 ADD CONSTRAINT build_groups_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
1934
1935
a1bc4962
MT
1936--
1937-- Name: build_groups build_groups_tested_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
1938--
1939
1940ALTER TABLE ONLY public.build_groups
1941 ADD CONSTRAINT build_groups_tested_build_id FOREIGN KEY (tested_build_id) REFERENCES public.builds(id);
1942
1943
44f74dd6 1944--
c734cf6c 1945-- Name: build_packages build_packages_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
44f74dd6
MT
1946--
1947
1948ALTER TABLE ONLY public.build_packages
1949 ADD CONSTRAINT build_packages_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
1950
1951
1952--
c734cf6c 1953-- Name: build_packages build_packages_job_id; Type: FK CONSTRAINT; Schema: public; Owner: -
44f74dd6
MT
1954--
1955
1956ALTER TABLE ONLY public.build_packages
1957 ADD CONSTRAINT build_packages_job_id FOREIGN KEY (job_id) REFERENCES public.jobs(id);
1958
1959
1960--
c734cf6c 1961-- Name: build_packages build_packages_package_id; Type: FK CONSTRAINT; Schema: public; Owner: -
44f74dd6
MT
1962--
1963
1964ALTER TABLE ONLY public.build_packages
1965 ADD CONSTRAINT build_packages_package_id FOREIGN KEY (package_id) REFERENCES public.packages(id);
1966
1967
100b864f
MT
1968--
1969-- Name: build_points build_points_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
1970--
1971
1972ALTER TABLE ONLY public.build_points
1973 ADD CONSTRAINT build_points_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
1974
1975
1976--
1977-- Name: build_points build_points_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
1978--
1979
1980ALTER TABLE ONLY public.build_points
1981 ADD CONSTRAINT build_points_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
1982
1983
6c6380e1
MT
1984--
1985-- Name: build_watchers build_watchers_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
1986--
1987
1988ALTER TABLE ONLY public.build_watchers
1989 ADD CONSTRAINT build_watchers_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
1990
1991
1992--
1993-- Name: build_watchers build_watchers_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
1994--
1995
1996ALTER TABLE ONLY public.build_watchers
1997 ADD CONSTRAINT build_watchers_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
1998
1999
3a4c6436 2000--
c734cf6c 2001-- Name: builder_stats builder_stats_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: -
3a4c6436
MT
2002--
2003
2004ALTER TABLE ONLY public.builder_stats
2005 ADD CONSTRAINT builder_stats_builder_id FOREIGN KEY (builder_id) REFERENCES public.builders(id);
2006
2007
e844251a
MT
2008--
2009-- Name: builders builders_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2010--
2011
2012ALTER TABLE ONLY public.builders
2013 ADD CONSTRAINT builders_created_by FOREIGN KEY (created_by) REFERENCES public.users(id);
2014
2015
2016--
2017-- Name: builders builders_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2018--
2019
2020ALTER TABLE ONLY public.builders
2021 ADD CONSTRAINT builders_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
2022
2023
668846ac
MT
2024--
2025-- Name: builds builds_build_group_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2026--
2027
2028ALTER TABLE ONLY public.builds
2029 ADD CONSTRAINT builds_build_group_id FOREIGN KEY (build_group_id) REFERENCES public.build_groups(id);
2030
2031
439d364e 2032--
c734cf6c 2033-- Name: builds builds_build_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2034--
2035
64d74848
MT
2036ALTER TABLE ONLY public.builds
2037 ADD CONSTRAINT builds_build_repo_id FOREIGN KEY (build_repo_id) REFERENCES public.repositories(id);
439d364e
MT
2038
2039
2040--
d0f83268 2041-- Name: build_comments builds_comments_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2042--
2043
d0f83268 2044ALTER TABLE ONLY public.build_comments
64d74848 2045 ADD CONSTRAINT builds_comments_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
439d364e
MT
2046
2047
439d364e 2048--
d0f83268 2049-- Name: build_comments builds_comments_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2050--
2051
d0f83268 2052ALTER TABLE ONLY public.build_comments
64d74848 2053 ADD CONSTRAINT builds_comments_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
439d364e
MT
2054
2055
7ff8f45a
MT
2056--
2057-- Name: builds builds_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2058--
2059
2060ALTER TABLE ONLY public.builds
2061 ADD CONSTRAINT builds_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
2062
2063
984b00df
MT
2064--
2065-- Name: builds builds_deprecated_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2066--
2067
2068ALTER TABLE ONLY public.builds
29b3094b
MT
2069 ADD CONSTRAINT builds_deprecated_by FOREIGN KEY (deprecated_by) REFERENCES public.users(id);
2070
2071
2072--
2073-- Name: builds builds_deprecating_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2074--
2075
2076ALTER TABLE ONLY public.builds
2077 ADD CONSTRAINT builds_deprecating_build_id FOREIGN KEY (deprecating_build_id) REFERENCES public.builds(id);
984b00df
MT
2078
2079
439d364e 2080--
c734cf6c 2081-- Name: builds builds_owner_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2082--
2083
67fb52de
MT
2084ALTER TABLE ONLY public.builds
2085 ADD CONSTRAINT builds_owner_id FOREIGN KEY (owner_id) REFERENCES public.users(id);
439d364e
MT
2086
2087
2088--
c734cf6c 2089-- Name: builds builds_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2090--
2091
67fb52de
MT
2092ALTER TABLE ONLY public.builds
2093 ADD CONSTRAINT builds_pkg_id FOREIGN KEY (pkg_id) REFERENCES public.packages(id);
439d364e
MT
2094
2095
695cec66 2096--
a9a942b5 2097-- Name: builds builds_test_group_id; Type: FK CONSTRAINT; Schema: public; Owner: -
695cec66
MT
2098--
2099
2100ALTER TABLE ONLY public.builds
a9a942b5 2101 ADD CONSTRAINT builds_test_group_id FOREIGN KEY (test_group_id) REFERENCES public.build_groups(id);
695cec66
MT
2102
2103
d6105088 2104--
cbcacbc9 2105-- Name: job_packages job_packages_job_id; Type: FK CONSTRAINT; Schema: public; Owner: -
d6105088
MT
2106--
2107
cbcacbc9
MT
2108ALTER TABLE ONLY public.job_packages
2109 ADD CONSTRAINT job_packages_job_id FOREIGN KEY (job_id) REFERENCES public.jobs(id);
d6105088
MT
2110
2111
439d364e 2112--
cbcacbc9 2113-- Name: job_packages job_packages_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2114--
2115
cbcacbc9
MT
2116ALTER TABLE ONLY public.job_packages
2117 ADD CONSTRAINT job_packages_pkg_id FOREIGN KEY (pkg_id) REFERENCES public.packages(id);
439d364e
MT
2118
2119
2120--
cbcacbc9 2121-- Name: jobs jobs_aborted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2122--
2123
67fb52de 2124ALTER TABLE ONLY public.jobs
cbcacbc9 2125 ADD CONSTRAINT jobs_aborted_by FOREIGN KEY (aborted_by) REFERENCES public.users(id);
439d364e
MT
2126
2127
dfa73e6f 2128--
cbcacbc9 2129-- Name: jobs jobs_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
dfa73e6f
MT
2130--
2131
2132ALTER TABLE ONLY public.jobs
cbcacbc9 2133 ADD CONSTRAINT jobs_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
dfa73e6f
MT
2134
2135
439d364e 2136--
cbcacbc9 2137-- Name: jobs jobs_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2138--
2139
cbcacbc9
MT
2140ALTER TABLE ONLY public.jobs
2141 ADD CONSTRAINT jobs_builder_id FOREIGN KEY (builder_id) REFERENCES public.builders(id);
439d364e
MT
2142
2143
2144--
cbcacbc9 2145-- Name: jobs jobs_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2146--
2147
cbcacbc9
MT
2148ALTER TABLE ONLY public.jobs
2149 ADD CONSTRAINT jobs_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
439d364e
MT
2150
2151
84f143b0 2152--
c734cf6c 2153-- Name: jobs jobs_superseeded_by; Type: FK CONSTRAINT; Schema: public; Owner: -
84f143b0
MT
2154--
2155
67fb52de
MT
2156ALTER TABLE ONLY public.jobs
2157 ADD CONSTRAINT jobs_superseeded_by FOREIGN KEY (superseeded_by) REFERENCES public.jobs(id);
84f143b0
MT
2158
2159
439d364e 2160--
d779a125 2161-- Name: keys keys_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2162--
2163
2cb08e49 2164ALTER TABLE ONLY public.keys
d779a125
MT
2165 ADD CONSTRAINT keys_created_by FOREIGN KEY (created_by) REFERENCES public.users(id);
2166
2167
2168--
2169-- Name: keys keys_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2170--
2171
2172ALTER TABLE ONLY public.keys
2173 ADD CONSTRAINT keys_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
439d364e
MT
2174
2175
c660ff59 2176--
1523bc41 2177-- Name: mirror_checks mirror_checks_mirror_id; Type: FK CONSTRAINT; Schema: public; Owner: -
c660ff59
MT
2178--
2179
1523bc41
MT
2180ALTER TABLE ONLY public.mirror_checks
2181 ADD CONSTRAINT mirror_checks_mirror_id FOREIGN KEY (mirror_id) REFERENCES public.mirrors(id);
2182
2183
2184--
2185-- Name: mirrors mirrors_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2186--
2187
2188ALTER TABLE ONLY public.mirrors
2189 ADD CONSTRAINT mirrors_created_by FOREIGN KEY (created_by) REFERENCES public.users(id);
2190
2191
2192--
2193-- Name: mirrors mirrors_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2194--
2195
2196ALTER TABLE ONLY public.mirrors
2197 ADD CONSTRAINT mirrors_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
c660ff59
MT
2198
2199
0d66487a
MT
2200--
2201-- Name: package_files package_files_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2202--
2203
2204ALTER TABLE ONLY public.package_files
2205 ADD CONSTRAINT package_files_pkg_id FOREIGN KEY (pkg_id) REFERENCES public.packages(id);
2206
2207
f835411e 2208--
c734cf6c 2209-- Name: packages packages_commit_id; Type: FK CONSTRAINT; Schema: public; Owner: -
f835411e
MT
2210--
2211
67fb52de 2212ALTER TABLE ONLY public.packages
c701b87e 2213 ADD CONSTRAINT packages_commit_id FOREIGN KEY (commit_id) REFERENCES public.source_commits(id);
f835411e
MT
2214
2215
7ad8efc5
MT
2216--
2217-- Name: packages packages_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2218--
2219
2220ALTER TABLE ONLY public.packages
2221 ADD CONSTRAINT packages_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
2222
2223
64991f9f
MT
2224--
2225-- Name: packages packages_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2226--
2227
2228ALTER TABLE ONLY public.packages
2229 ADD CONSTRAINT packages_distro_id FOREIGN KEY (distro_id) REFERENCES public.distributions(id);
2230
2231
7e1322ca
MT
2232--
2233-- Name: release_images release_images_release_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2234--
2235
2236ALTER TABLE ONLY public.release_images
2237 ADD CONSTRAINT release_images_release_id FOREIGN KEY (release_id) REFERENCES public.releases(id);
2238
2239
2240--
2241-- Name: release_images release_images_type_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2242--
2243
2244ALTER TABLE ONLY public.release_images
2245 ADD CONSTRAINT release_images_type_id FOREIGN KEY (type_id) REFERENCES public.images_types(id);
2246
2247
d779a125
MT
2248--
2249-- Name: release_monitoring_releases release_monitoring_releases_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2250--
2251
2252ALTER TABLE ONLY public.release_monitoring_releases
2253 ADD CONSTRAINT release_monitoring_releases_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
2254
2255
3d7f0b67 2256--
2913e04e 2257-- Name: release_monitoring_releases release_monitoring_releases_monitoring_id; Type: FK CONSTRAINT; Schema: public; Owner: -
3d7f0b67
MT
2258--
2259
2913e04e
MT
2260ALTER TABLE ONLY public.release_monitoring_releases
2261 ADD CONSTRAINT release_monitoring_releases_monitoring_id FOREIGN KEY (monitoring_id) REFERENCES public.release_monitorings(id);
3d7f0b67
MT
2262
2263
1648678e
MT
2264--
2265-- Name: release_monitoring_releases release_monitoring_releases_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2266--
2267
2268ALTER TABLE ONLY public.release_monitoring_releases
2269 ADD CONSTRAINT release_monitoring_releases_repo_id FOREIGN KEY (repo_id) REFERENCES public.repositories(id);
2270
2271
3d7f0b67 2272--
2913e04e 2273-- Name: release_monitorings release_monitorings_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
3d7f0b67
MT
2274--
2275
2913e04e
MT
2276ALTER TABLE ONLY public.release_monitorings
2277 ADD CONSTRAINT release_monitorings_created_by FOREIGN KEY (created_by) REFERENCES public.users(id);
3d7f0b67
MT
2278
2279
2280--
2913e04e 2281-- Name: release_monitorings release_monitorings_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
3d7f0b67
MT
2282--
2283
2913e04e
MT
2284ALTER TABLE ONLY public.release_monitorings
2285 ADD CONSTRAINT release_monitorings_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
3d7f0b67
MT
2286
2287
2288--
2913e04e 2289-- Name: release_monitorings release_monitorings_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: -
3d7f0b67
MT
2290--
2291
2913e04e
MT
2292ALTER TABLE ONLY public.release_monitorings
2293 ADD CONSTRAINT release_monitorings_distro_id FOREIGN KEY (distro_id) REFERENCES public.distributions(id);
3d7f0b67
MT
2294
2295
7e1322ca
MT
2296--
2297-- Name: releases releases_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2298--
2299
2300ALTER TABLE ONLY public.releases
2301 ADD CONSTRAINT releases_created_by FOREIGN KEY (created_by) REFERENCES public.users(id);
2302
2303
2304--
2305-- Name: releases releases_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2306--
2307
2308ALTER TABLE ONLY public.releases
2309 ADD CONSTRAINT releases_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
2310
2311
2312--
2313-- Name: releases releases_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2314--
2315
2316ALTER TABLE ONLY public.releases
2317 ADD CONSTRAINT releases_distro_id FOREIGN KEY (distro_id) REFERENCES public.distributions(id);
2318
2319
fe17d32f
MT
2320--
2321-- Name: repositories repositories_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2322--
2323
2324ALTER TABLE ONLY public.repositories
2325 ADD CONSTRAINT repositories_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
2326
2327
439d364e 2328--
c734cf6c 2329-- Name: repositories repositories_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2330--
2331
67fb52de
MT
2332ALTER TABLE ONLY public.repositories
2333 ADD CONSTRAINT repositories_distro_id FOREIGN KEY (distro_id) REFERENCES public.distributions(id);
439d364e
MT
2334
2335
439d364e 2336--
c734cf6c 2337-- Name: repositories repositories_key_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2338--
2339
67fb52de
MT
2340ALTER TABLE ONLY public.repositories
2341 ADD CONSTRAINT repositories_key_id FOREIGN KEY (key_id) REFERENCES public.keys(id);
439d364e
MT
2342
2343
2344--
c734cf6c 2345-- Name: repositories repositories_owner_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2346--
2347
67fb52de 2348ALTER TABLE ONLY public.repositories
f87d64a2 2349 ADD CONSTRAINT repositories_owner_id FOREIGN KEY (owner_id) REFERENCES public.users(id);
439d364e
MT
2350
2351
ee20e731
MT
2352--
2353-- Name: repository_builds repository_builds_added_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2354--
2355
2356ALTER TABLE ONLY public.repository_builds
2357 ADD CONSTRAINT repository_builds_added_by FOREIGN KEY (added_by) REFERENCES public.users(id);
2358
2359
2360--
2361-- Name: repository_builds repository_builds_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2362--
2363
2364ALTER TABLE ONLY public.repository_builds
2365 ADD CONSTRAINT repository_builds_build_id FOREIGN KEY (build_id) REFERENCES public.builds(id);
2366
2367
2368--
2369-- Name: repository_builds repository_builds_removed_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2370--
2371
2372ALTER TABLE ONLY public.repository_builds
2373 ADD CONSTRAINT repository_builds_removed_by FOREIGN KEY (removed_by) REFERENCES public.users(id);
2374
2375
2376--
2377-- Name: repository_builds repository_builds_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2378--
2379
2380ALTER TABLE ONLY public.repository_builds
2381 ADD CONSTRAINT repository_builds_repo_id FOREIGN KEY (repo_id) REFERENCES public.repositories(id);
2382
2383
439d364e 2384--
c734cf6c 2385-- Name: sessions sessions_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2386--
2387
67fb52de
MT
2388ALTER TABLE ONLY public.sessions
2389 ADD CONSTRAINT sessions_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
439d364e
MT
2390
2391
07c337e7
MT
2392--
2393-- Name: source_commit_jobs source_commit_jobs_commit_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2394--
2395
2396ALTER TABLE ONLY public.source_commit_jobs
2397 ADD CONSTRAINT source_commit_jobs_commit_id FOREIGN KEY (commit_id) REFERENCES public.source_commits(id);
2398
2399
2400--
2401-- Name: source_commits source_commits_build_group_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2402--
2403
2404ALTER TABLE ONLY public.source_commits
2405 ADD CONSTRAINT source_commits_build_group_id FOREIGN KEY (build_group_id) REFERENCES public.build_groups(id);
2406
2407
439d364e 2408--
c701b87e 2409-- Name: source_commits sources_commits_source_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2410--
2411
c701b87e 2412ALTER TABLE ONLY public.source_commits
67fb52de 2413 ADD CONSTRAINT sources_commits_source_id FOREIGN KEY (source_id) REFERENCES public.sources(id);
439d364e
MT
2414
2415
2416--
c701b87e
MT
2417-- Name: sources sources_created_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2418--
2419
2420ALTER TABLE ONLY public.sources
2421 ADD CONSTRAINT sources_created_by FOREIGN KEY (created_by) REFERENCES public.users(id);
2422
2423
2424--
2425-- Name: sources sources_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
2426--
2427
2428ALTER TABLE ONLY public.sources
2429 ADD CONSTRAINT sources_deleted_by FOREIGN KEY (deleted_by) REFERENCES public.users(id);
2430
2431
2432--
2433-- Name: sources sources_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2434--
2435
67fb52de 2436ALTER TABLE ONLY public.sources
c701b87e 2437 ADD CONSTRAINT sources_repo_id FOREIGN KEY (repo_id) REFERENCES public.repositories(id);
439d364e
MT
2438
2439
2440--
c734cf6c 2441-- Name: uploads uploads_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2442--
2443
67fb52de
MT
2444ALTER TABLE ONLY public.uploads
2445 ADD CONSTRAINT uploads_builder_id FOREIGN KEY (builder_id) REFERENCES public.builders(id);
439d364e
MT
2446
2447
2448--
c734cf6c 2449-- Name: uploads uploads_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
439d364e
MT
2450--
2451
67fb52de
MT
2452ALTER TABLE ONLY public.uploads
2453 ADD CONSTRAINT uploads_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
439d364e
MT
2454
2455
d48f75f7
MT
2456--
2457-- Name: user_push_subscriptions user_push_subscriptions_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2458--
2459
2460ALTER TABLE ONLY public.user_push_subscriptions
2461 ADD CONSTRAINT user_push_subscriptions_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
2462
2463
b1491f00
MT
2464--
2465-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: -
2466--
2467
2468REVOKE USAGE ON SCHEMA public FROM PUBLIC;
2469GRANT ALL ON SCHEMA public TO PUBLIC;
2470
2471
64316541
MT
2472--
2473-- PostgreSQL database dump complete
2474--
9050c160 2475