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