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