]> git.ipfire.org Git - pbs.git/blob - src/database.sql
Remember when builders are online
[pbs.git] / src / database.sql
1 --
2 -- PostgreSQL database dump
3 --
4
5 SET statement_timeout = 0;
6 SET lock_timeout = 0;
7 SET client_encoding = 'UTF8';
8 SET standard_conforming_strings = on;
9 SET check_function_bodies = false;
10 SET client_min_messages = warning;
11
12 --
13 -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
14 --
15
16 CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
17
18
19 --
20 -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
21 --
22
23 COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
24
25
26 SET search_path = public, pg_catalog;
27
28 --
29 -- Name: on_update_current_timestamp_sources(); Type: FUNCTION; Schema: public; Owner: pakfire
30 --
31
32 CREATE FUNCTION on_update_current_timestamp_sources() RETURNS trigger
33 LANGUAGE plpgsql
34 AS $$
35 BEGIN
36 NEW.updated = now();
37 RETURN NEW;
38 END;
39 $$;
40
41
42 ALTER FUNCTION public.on_update_current_timestamp_sources() OWNER TO pakfire;
43
44 SET default_tablespace = '';
45
46 SET default_with_oids = false;
47
48 --
49 -- Name: arches; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
50 --
51
52 CREATE TABLE arches (
53 id integer NOT NULL,
54 name text NOT NULL
55 );
56
57
58 ALTER TABLE arches OWNER TO pakfire;
59
60 --
61 -- Name: arches_compat; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
62 --
63
64 CREATE TABLE arches_compat (
65 native_arch text NOT NULL,
66 build_arch text NOT NULL,
67 CONSTRAINT arches_compat_unique CHECK ((native_arch <> build_arch))
68 );
69
70
71 ALTER TABLE arches_compat OWNER TO pakfire;
72
73 --
74 -- Name: arches_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
75 --
76
77 CREATE SEQUENCE arches_id_seq
78 START WITH 1
79 INCREMENT BY 1
80 NO MINVALUE
81 NO MAXVALUE
82 CACHE 1;
83
84
85 ALTER TABLE arches_id_seq OWNER TO pakfire;
86
87 --
88 -- Name: arches_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
89 --
90
91 ALTER SEQUENCE arches_id_seq OWNED BY arches.id;
92
93
94 --
95 -- Name: builders; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
96 --
97
98 CREATE TABLE builders (
99 id integer NOT NULL,
100 name text NOT NULL,
101 passphrase text,
102 description text,
103 enabled boolean DEFAULT false NOT NULL,
104 deleted boolean DEFAULT false NOT NULL,
105 loadavg text DEFAULT '0'::character varying NOT NULL,
106 testmode boolean DEFAULT true NOT NULL,
107 max_jobs bigint DEFAULT 1::bigint NOT NULL,
108 pakfire_version text,
109 os_name text,
110 cpu_model text,
111 cpu_count integer DEFAULT 1 NOT NULL,
112 cpu_arch text,
113 cpu_bogomips double precision,
114 memory bigint DEFAULT 0 NOT NULL,
115 free_space bigint DEFAULT 0 NOT NULL,
116 host_key_id text,
117 time_created timestamp without time zone DEFAULT now() NOT NULL,
118 time_updated timestamp without time zone,
119 time_keepalive timestamp without time zone,
120 loadavg1 double precision,
121 loadavg5 double precision,
122 loadavg15 double precision,
123 mem_total bigint,
124 mem_free bigint,
125 swap_total bigint,
126 swap_free bigint,
127 space_free bigint,
128 online_until timestamp without time zone
129 );
130
131
132 ALTER TABLE builders OWNER TO pakfire;
133
134 --
135 -- Name: builders_history; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
136 --
137
138 CREATE TABLE builders_history (
139 id integer NOT NULL,
140 builder_id integer NOT NULL,
141 action text NOT NULL,
142 user_id integer,
143 "time" timestamp without time zone NOT NULL
144 );
145
146
147 ALTER TABLE builders_history OWNER TO pakfire;
148
149 --
150 -- Name: builders_history_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
151 --
152
153 CREATE SEQUENCE builders_history_id_seq
154 START WITH 1
155 INCREMENT BY 1
156 NO MINVALUE
157 NO MAXVALUE
158 CACHE 1;
159
160
161 ALTER TABLE builders_history_id_seq OWNER TO pakfire;
162
163 --
164 -- Name: builders_history_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
165 --
166
167 ALTER SEQUENCE builders_history_id_seq OWNED BY builders_history.id;
168
169
170 --
171 -- Name: builders_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
172 --
173
174 CREATE SEQUENCE builders_id_seq
175 START WITH 1
176 INCREMENT BY 1
177 NO MINVALUE
178 NO MAXVALUE
179 CACHE 1;
180
181
182 ALTER TABLE builders_id_seq OWNER TO pakfire;
183
184 --
185 -- Name: builders_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
186 --
187
188 ALTER SEQUENCE builders_id_seq OWNED BY builders.id;
189
190
191 --
192 -- Name: builds; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
193 --
194
195 CREATE TABLE builds (
196 id integer NOT NULL,
197 uuid text NOT NULL,
198 pkg_id integer NOT NULL,
199 type text DEFAULT 'release'::text NOT NULL,
200 state text DEFAULT 'building'::text NOT NULL,
201 severity text,
202 message text,
203 time_created timestamp without time zone DEFAULT now() NOT NULL,
204 update_year integer,
205 update_num integer,
206 depends_on integer,
207 distro_id integer NOT NULL,
208 owner_id integer,
209 priority integer DEFAULT 0 NOT NULL,
210 auto_move boolean DEFAULT false NOT NULL
211 );
212
213
214 ALTER TABLE builds OWNER TO pakfire;
215
216 --
217 -- Name: builds_bugs; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
218 --
219
220 CREATE TABLE builds_bugs (
221 id integer NOT NULL,
222 build_id integer NOT NULL,
223 bug_id integer NOT NULL
224 );
225
226
227 ALTER TABLE builds_bugs OWNER TO pakfire;
228
229 --
230 -- Name: builds_bugs_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
231 --
232
233 CREATE SEQUENCE builds_bugs_id_seq
234 START WITH 1
235 INCREMENT BY 1
236 NO MINVALUE
237 NO MAXVALUE
238 CACHE 1;
239
240
241 ALTER TABLE builds_bugs_id_seq OWNER TO pakfire;
242
243 --
244 -- Name: builds_bugs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
245 --
246
247 ALTER SEQUENCE builds_bugs_id_seq OWNED BY builds_bugs.id;
248
249
250 --
251 -- Name: builds_bugs_updates; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
252 --
253
254 CREATE TABLE builds_bugs_updates (
255 id integer NOT NULL,
256 bug_id integer NOT NULL,
257 status text,
258 resolution text,
259 comment text,
260 "time" timestamp without time zone NOT NULL,
261 error boolean DEFAULT false NOT NULL,
262 error_msg text
263 );
264
265
266 ALTER TABLE builds_bugs_updates OWNER TO pakfire;
267
268 --
269 -- Name: builds_bugs_updates_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
270 --
271
272 CREATE SEQUENCE builds_bugs_updates_id_seq
273 START WITH 1
274 INCREMENT BY 1
275 NO MINVALUE
276 NO MAXVALUE
277 CACHE 1;
278
279
280 ALTER TABLE builds_bugs_updates_id_seq OWNER TO pakfire;
281
282 --
283 -- Name: builds_bugs_updates_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
284 --
285
286 ALTER SEQUENCE builds_bugs_updates_id_seq OWNED BY builds_bugs_updates.id;
287
288
289 --
290 -- Name: builds_comments; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
291 --
292
293 CREATE TABLE builds_comments (
294 id integer NOT NULL,
295 build_id integer NOT NULL,
296 user_id integer NOT NULL,
297 text text,
298 score integer NOT NULL,
299 time_created timestamp without time zone DEFAULT now() NOT NULL,
300 time_updated timestamp without time zone
301 );
302
303
304 ALTER TABLE builds_comments OWNER TO pakfire;
305
306 --
307 -- Name: builds_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
308 --
309
310 CREATE SEQUENCE builds_comments_id_seq
311 START WITH 1
312 INCREMENT BY 1
313 NO MINVALUE
314 NO MAXVALUE
315 CACHE 1;
316
317
318 ALTER TABLE builds_comments_id_seq OWNER TO pakfire;
319
320 --
321 -- Name: builds_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
322 --
323
324 ALTER SEQUENCE builds_comments_id_seq OWNED BY builds_comments.id;
325
326
327 --
328 -- Name: builds_history; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
329 --
330
331 CREATE TABLE builds_history (
332 id integer NOT NULL,
333 build_id integer NOT NULL,
334 action text NOT NULL,
335 user_id integer,
336 "time" timestamp without time zone NOT NULL,
337 bug_id integer
338 );
339
340
341 ALTER TABLE builds_history OWNER TO pakfire;
342
343 --
344 -- Name: builds_history_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
345 --
346
347 CREATE SEQUENCE builds_history_id_seq
348 START WITH 1
349 INCREMENT BY 1
350 NO MINVALUE
351 NO MAXVALUE
352 CACHE 1;
353
354
355 ALTER TABLE builds_history_id_seq OWNER TO pakfire;
356
357 --
358 -- Name: builds_history_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
359 --
360
361 ALTER SEQUENCE builds_history_id_seq OWNED BY builds_history.id;
362
363
364 --
365 -- Name: builds_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
366 --
367
368 CREATE SEQUENCE builds_id_seq
369 START WITH 1
370 INCREMENT BY 1
371 NO MINVALUE
372 NO MAXVALUE
373 CACHE 1;
374
375
376 ALTER TABLE builds_id_seq OWNER TO pakfire;
377
378 --
379 -- Name: builds_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
380 --
381
382 ALTER SEQUENCE builds_id_seq OWNED BY builds.id;
383
384
385 --
386 -- Name: jobs; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
387 --
388
389 CREATE TABLE jobs (
390 id integer NOT NULL,
391 uuid text NOT NULL,
392 build_id integer NOT NULL,
393 state text DEFAULT 'pending'::text NOT NULL,
394 arch text NOT NULL,
395 time_created timestamp without time zone DEFAULT now() NOT NULL,
396 time_started timestamp without time zone,
397 time_finished timestamp without time zone,
398 start_not_before timestamp without time zone,
399 builder_id integer,
400 aborted_state integer DEFAULT 0 NOT NULL,
401 message text,
402 test boolean DEFAULT true NOT NULL,
403 superseeded_by integer,
404 dependency_check_succeeded boolean,
405 dependency_check_at timestamp without time zone,
406 CONSTRAINT jobs_states CHECK ((state = ANY (ARRAY['pending'::text, 'dispatching'::text, 'running'::text, 'uploading'::text, 'finished'::text, 'aborted'::text, 'download_error'::text, 'failed'::text])))
407 );
408
409
410 ALTER TABLE jobs OWNER TO pakfire;
411
412 --
413 -- Name: builds_times; Type: VIEW; Schema: public; Owner: pakfire
414 --
415
416 CREATE VIEW builds_times AS
417 SELECT jobs.build_id,
418 jobs.arch,
419 date_part('epoch'::text, (jobs.time_finished - jobs.time_started)) AS duration
420 FROM jobs
421 WHERE ((jobs.test IS FALSE) AND (jobs.state = 'finished'::text));
422
423
424 ALTER TABLE builds_times OWNER TO pakfire;
425
426 --
427 -- Name: builds_watchers; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
428 --
429
430 CREATE TABLE builds_watchers (
431 id integer NOT NULL,
432 build_id integer NOT NULL,
433 user_id integer NOT NULL
434 );
435
436
437 ALTER TABLE builds_watchers OWNER TO pakfire;
438
439 --
440 -- Name: builds_watchers_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
441 --
442
443 CREATE SEQUENCE builds_watchers_id_seq
444 START WITH 1
445 INCREMENT BY 1
446 NO MINVALUE
447 NO MAXVALUE
448 CACHE 1;
449
450
451 ALTER TABLE builds_watchers_id_seq OWNER TO pakfire;
452
453 --
454 -- Name: builds_watchers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
455 --
456
457 ALTER SEQUENCE builds_watchers_id_seq OWNED BY builds_watchers.id;
458
459
460 --
461 -- Name: distributions; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
462 --
463
464 CREATE TABLE distributions (
465 id integer NOT NULL,
466 name text NOT NULL,
467 sname text NOT NULL,
468 slogan text NOT NULL,
469 description text,
470 vendor text NOT NULL,
471 contact text,
472 tag text NOT NULL,
473 deleted boolean DEFAULT false NOT NULL
474 );
475
476
477 ALTER TABLE distributions OWNER TO pakfire;
478
479 --
480 -- Name: distributions_arches; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
481 --
482
483 CREATE TABLE distributions_arches (
484 id integer NOT NULL,
485 distro_id integer NOT NULL,
486 arch text NOT NULL
487 );
488
489
490 ALTER TABLE distributions_arches OWNER TO pakfire;
491
492 --
493 -- Name: distributions_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
494 --
495
496 CREATE SEQUENCE distributions_id_seq
497 START WITH 1
498 INCREMENT BY 1
499 NO MINVALUE
500 NO MAXVALUE
501 CACHE 1;
502
503
504 ALTER TABLE distributions_id_seq OWNER TO pakfire;
505
506 --
507 -- Name: distributions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
508 --
509
510 ALTER SEQUENCE distributions_id_seq OWNED BY distributions.id;
511
512
513 --
514 -- Name: distro_arches_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
515 --
516
517 CREATE SEQUENCE distro_arches_id_seq
518 START WITH 1
519 INCREMENT BY 1
520 NO MINVALUE
521 NO MAXVALUE
522 CACHE 1;
523
524
525 ALTER TABLE distro_arches_id_seq OWNER TO pakfire;
526
527 --
528 -- Name: distro_arches_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
529 --
530
531 ALTER SEQUENCE distro_arches_id_seq OWNED BY distributions_arches.id;
532
533
534 --
535 -- Name: filelists; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
536 --
537
538 CREATE TABLE filelists (
539 pkg_id integer NOT NULL,
540 name text NOT NULL,
541 size bigint NOT NULL,
542 hash_sha512 text,
543 type integer NOT NULL,
544 config boolean NOT NULL,
545 mode integer NOT NULL,
546 "user" text NOT NULL,
547 "group" text NOT NULL,
548 mtime timestamp without time zone NOT NULL,
549 capabilities text
550 );
551
552
553 ALTER TABLE filelists OWNER TO pakfire;
554
555 --
556 -- Name: images_types; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
557 --
558
559 CREATE TABLE images_types (
560 id integer NOT NULL,
561 type text NOT NULL
562 );
563
564
565 ALTER TABLE images_types OWNER TO pakfire;
566
567 --
568 -- Name: images_types_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
569 --
570
571 CREATE SEQUENCE images_types_id_seq
572 START WITH 1
573 INCREMENT BY 1
574 NO MINVALUE
575 NO MAXVALUE
576 CACHE 1;
577
578
579 ALTER TABLE images_types_id_seq OWNER TO pakfire;
580
581 --
582 -- Name: images_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
583 --
584
585 ALTER SEQUENCE images_types_id_seq OWNED BY images_types.id;
586
587
588 --
589 -- Name: jobs_buildroots; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
590 --
591
592 CREATE TABLE jobs_buildroots (
593 job_id integer NOT NULL,
594 pkg_uuid text NOT NULL,
595 pkg_name text NOT NULL
596 );
597
598
599 ALTER TABLE jobs_buildroots OWNER TO pakfire;
600
601 --
602 -- Name: jobs_history; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
603 --
604
605 CREATE TABLE jobs_history (
606 job_id integer NOT NULL,
607 action text NOT NULL,
608 state text,
609 user_id integer,
610 "time" timestamp without time zone NOT NULL,
611 builder_id integer,
612 test_job_id integer
613 );
614
615
616 ALTER TABLE jobs_history OWNER TO pakfire;
617
618 --
619 -- Name: jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
620 --
621
622 CREATE SEQUENCE jobs_id_seq
623 START WITH 1
624 INCREMENT BY 1
625 NO MINVALUE
626 NO MAXVALUE
627 CACHE 1;
628
629
630 ALTER TABLE jobs_id_seq OWNER TO pakfire;
631
632 --
633 -- Name: jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
634 --
635
636 ALTER SEQUENCE jobs_id_seq OWNED BY jobs.id;
637
638
639 --
640 -- Name: jobs_packages; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
641 --
642
643 CREATE TABLE jobs_packages (
644 id integer NOT NULL,
645 job_id integer NOT NULL,
646 pkg_id integer NOT NULL
647 );
648
649
650 ALTER TABLE jobs_packages OWNER TO pakfire;
651
652 --
653 -- Name: jobs_packages_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
654 --
655
656 CREATE SEQUENCE jobs_packages_id_seq
657 START WITH 1
658 INCREMENT BY 1
659 NO MINVALUE
660 NO MAXVALUE
661 CACHE 1;
662
663
664 ALTER TABLE jobs_packages_id_seq OWNER TO pakfire;
665
666 --
667 -- Name: jobs_packages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
668 --
669
670 ALTER SEQUENCE jobs_packages_id_seq OWNED BY jobs_packages.id;
671
672
673 --
674 -- Name: jobs_queue; Type: VIEW; Schema: public; Owner: pakfire
675 --
676
677 CREATE VIEW jobs_queue AS
678 WITH queue AS (
679 SELECT jobs.id,
680 rank() OVER (ORDER BY (NOT jobs.test), builds.priority DESC, jobs.time_created) AS rank
681 FROM (jobs
682 LEFT JOIN builds ON ((jobs.build_id = builds.id)))
683 WHERE ((jobs.state = 'pending'::text) AND (jobs.dependency_check_succeeded IS TRUE))
684 )
685 SELECT queue.id AS job_id,
686 queue.rank
687 FROM queue;
688
689
690 ALTER TABLE jobs_queue OWNER TO pakfire;
691
692 --
693 -- Name: jobs_repos; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
694 --
695
696 CREATE TABLE jobs_repos (
697 job_id integer NOT NULL,
698 repo_id integer NOT NULL
699 );
700
701
702 ALTER TABLE jobs_repos OWNER TO pakfire;
703
704 --
705 -- Name: keys; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
706 --
707
708 CREATE TABLE keys (
709 id integer NOT NULL,
710 fingerprint text NOT NULL,
711 uids text NOT NULL,
712 data text NOT NULL
713 );
714
715
716 ALTER TABLE keys OWNER TO pakfire;
717
718 --
719 -- Name: keys_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
720 --
721
722 CREATE SEQUENCE keys_id_seq
723 START WITH 1
724 INCREMENT BY 1
725 NO MINVALUE
726 NO MAXVALUE
727 CACHE 1;
728
729
730 ALTER TABLE keys_id_seq OWNER TO pakfire;
731
732 --
733 -- Name: keys_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
734 --
735
736 ALTER SEQUENCE keys_id_seq OWNED BY keys.id;
737
738
739 --
740 -- Name: keys_subkeys; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
741 --
742
743 CREATE TABLE keys_subkeys (
744 id integer NOT NULL,
745 key_id integer NOT NULL,
746 fingerprint text NOT NULL,
747 time_created timestamp without time zone NOT NULL,
748 time_expires timestamp without time zone,
749 algo text
750 );
751
752
753 ALTER TABLE keys_subkeys OWNER TO pakfire;
754
755 --
756 -- Name: keys_subkeys_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
757 --
758
759 CREATE SEQUENCE keys_subkeys_id_seq
760 START WITH 1
761 INCREMENT BY 1
762 NO MINVALUE
763 NO MAXVALUE
764 CACHE 1;
765
766
767 ALTER TABLE keys_subkeys_id_seq OWNER TO pakfire;
768
769 --
770 -- Name: keys_subkeys_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
771 --
772
773 ALTER SEQUENCE keys_subkeys_id_seq OWNED BY keys_subkeys.id;
774
775
776 --
777 -- Name: logfiles; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
778 --
779
780 CREATE TABLE logfiles (
781 id integer NOT NULL,
782 job_id integer NOT NULL,
783 path text NOT NULL,
784 filesize bigint NOT NULL,
785 hash_sha512 text NOT NULL
786 );
787
788
789 ALTER TABLE logfiles OWNER TO pakfire;
790
791 --
792 -- Name: logfiles_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
793 --
794
795 CREATE SEQUENCE logfiles_id_seq
796 START WITH 1
797 INCREMENT BY 1
798 NO MINVALUE
799 NO MAXVALUE
800 CACHE 1;
801
802
803 ALTER TABLE logfiles_id_seq OWNER TO pakfire;
804
805 --
806 -- Name: logfiles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
807 --
808
809 ALTER SEQUENCE logfiles_id_seq OWNED BY logfiles.id;
810
811
812 --
813 -- Name: messages; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
814 --
815
816 CREATE TABLE messages (
817 id integer NOT NULL,
818 message text NOT NULL,
819 queued_at timestamp without time zone DEFAULT now() NOT NULL,
820 sent_at timestamp without time zone
821 );
822
823
824 ALTER TABLE messages OWNER TO pakfire;
825
826 --
827 -- Name: messages_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
828 --
829
830 CREATE SEQUENCE messages_id_seq
831 START WITH 1
832 INCREMENT BY 1
833 NO MINVALUE
834 NO MAXVALUE
835 CACHE 1;
836
837
838 ALTER TABLE messages_id_seq OWNER TO pakfire;
839
840 --
841 -- Name: messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
842 --
843
844 ALTER SEQUENCE messages_id_seq OWNED BY messages.id;
845
846
847 --
848 -- Name: mirrors; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
849 --
850
851 CREATE TABLE mirrors (
852 id integer NOT NULL,
853 hostname text NOT NULL,
854 path text NOT NULL,
855 owner text,
856 contact text,
857 deleted boolean DEFAULT false NOT NULL,
858 supports_https boolean DEFAULT false NOT NULL
859 );
860
861
862 ALTER TABLE mirrors OWNER TO pakfire;
863
864 --
865 -- Name: mirrors_checks; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
866 --
867
868 CREATE TABLE mirrors_checks (
869 id integer NOT NULL,
870 mirror_id integer NOT NULL,
871 "timestamp" timestamp without time zone DEFAULT now() NOT NULL,
872 response_time double precision,
873 http_status integer,
874 last_sync_at timestamp without time zone,
875 status text DEFAULT 'OK'::text NOT NULL
876 );
877
878
879 ALTER TABLE mirrors_checks OWNER TO pakfire;
880
881 --
882 -- Name: mirrors_checks_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
883 --
884
885 CREATE SEQUENCE mirrors_checks_id_seq
886 START WITH 1
887 INCREMENT BY 1
888 NO MINVALUE
889 NO MAXVALUE
890 CACHE 1;
891
892
893 ALTER TABLE mirrors_checks_id_seq OWNER TO pakfire;
894
895 --
896 -- Name: mirrors_checks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
897 --
898
899 ALTER SEQUENCE mirrors_checks_id_seq OWNED BY mirrors_checks.id;
900
901
902 --
903 -- Name: mirrors_history; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
904 --
905
906 CREATE TABLE mirrors_history (
907 id integer NOT NULL,
908 mirror_id integer NOT NULL,
909 action text NOT NULL,
910 user_id integer,
911 "time" timestamp without time zone NOT NULL
912 );
913
914
915 ALTER TABLE mirrors_history OWNER TO pakfire;
916
917 --
918 -- Name: mirrors_history_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
919 --
920
921 CREATE SEQUENCE mirrors_history_id_seq
922 START WITH 1
923 INCREMENT BY 1
924 NO MINVALUE
925 NO MAXVALUE
926 CACHE 1;
927
928
929 ALTER TABLE mirrors_history_id_seq OWNER TO pakfire;
930
931 --
932 -- Name: mirrors_history_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
933 --
934
935 ALTER SEQUENCE mirrors_history_id_seq OWNED BY mirrors_history.id;
936
937
938 --
939 -- Name: mirrors_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
940 --
941
942 CREATE SEQUENCE mirrors_id_seq
943 START WITH 1
944 INCREMENT BY 1
945 NO MINVALUE
946 NO MAXVALUE
947 CACHE 1;
948
949
950 ALTER TABLE mirrors_id_seq OWNER TO pakfire;
951
952 --
953 -- Name: mirrors_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
954 --
955
956 ALTER SEQUENCE mirrors_id_seq OWNED BY mirrors.id;
957
958
959 --
960 -- Name: packages; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
961 --
962
963 CREATE TABLE packages (
964 id integer NOT NULL,
965 name text NOT NULL,
966 epoch integer NOT NULL,
967 version text NOT NULL,
968 release text NOT NULL,
969 type text NOT NULL,
970 arch text NOT NULL,
971 groups text NOT NULL,
972 maintainer text NOT NULL,
973 license text NOT NULL,
974 url text NOT NULL,
975 summary text NOT NULL,
976 description text NOT NULL,
977 size bigint NOT NULL,
978 supported_arches text,
979 uuid text NOT NULL,
980 commit_id integer,
981 build_id text NOT NULL,
982 build_host text NOT NULL,
983 build_time timestamp without time zone NOT NULL,
984 path text NOT NULL,
985 filesize bigint NOT NULL,
986 hash_sha512 text NOT NULL
987 );
988
989
990 ALTER TABLE packages OWNER TO pakfire;
991
992 --
993 -- Name: packages_deps; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
994 --
995
996 CREATE TABLE packages_deps (
997 pkg_id integer NOT NULL,
998 type text NOT NULL,
999 what text NOT NULL
1000 );
1001
1002
1003 ALTER TABLE packages_deps OWNER TO pakfire;
1004
1005 --
1006 -- Name: packages_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1007 --
1008
1009 CREATE SEQUENCE packages_id_seq
1010 START WITH 1
1011 INCREMENT BY 1
1012 NO MINVALUE
1013 NO MAXVALUE
1014 CACHE 1;
1015
1016
1017 ALTER TABLE packages_id_seq OWNER TO pakfire;
1018
1019 --
1020 -- Name: packages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1021 --
1022
1023 ALTER SEQUENCE packages_id_seq OWNED BY packages.id;
1024
1025
1026 --
1027 -- Name: packages_properties; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1028 --
1029
1030 CREATE TABLE packages_properties (
1031 id integer NOT NULL,
1032 name text NOT NULL,
1033 critical_path boolean DEFAULT false NOT NULL,
1034 priority integer DEFAULT 0 NOT NULL
1035 );
1036
1037
1038 ALTER TABLE packages_properties OWNER TO pakfire;
1039
1040 --
1041 -- Name: packages_properties_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1042 --
1043
1044 CREATE SEQUENCE packages_properties_id_seq
1045 START WITH 1
1046 INCREMENT BY 1
1047 NO MINVALUE
1048 NO MAXVALUE
1049 CACHE 1;
1050
1051
1052 ALTER TABLE packages_properties_id_seq OWNER TO pakfire;
1053
1054 --
1055 -- Name: packages_properties_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1056 --
1057
1058 ALTER SEQUENCE packages_properties_id_seq OWNED BY packages_properties.id;
1059
1060
1061 --
1062 -- Name: queue_delete; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1063 --
1064
1065 CREATE TABLE queue_delete (
1066 id integer NOT NULL,
1067 path text NOT NULL,
1068 not_before timestamp without time zone
1069 );
1070
1071
1072 ALTER TABLE queue_delete OWNER TO pakfire;
1073
1074 --
1075 -- Name: queue_delete_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1076 --
1077
1078 CREATE SEQUENCE queue_delete_id_seq
1079 START WITH 1
1080 INCREMENT BY 1
1081 NO MINVALUE
1082 NO MAXVALUE
1083 CACHE 1;
1084
1085
1086 ALTER TABLE queue_delete_id_seq OWNER TO pakfire;
1087
1088 --
1089 -- Name: queue_delete_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1090 --
1091
1092 ALTER SEQUENCE queue_delete_id_seq OWNED BY queue_delete.id;
1093
1094
1095 --
1096 -- Name: relation_sizes; Type: VIEW; Schema: public; Owner: pakfire
1097 --
1098
1099 CREATE VIEW relation_sizes AS
1100 SELECT c.relname AS relation,
1101 pg_size_pretty(pg_relation_size((c.oid)::regclass)) AS size
1102 FROM (pg_class c
1103 LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace)))
1104 WHERE (n.nspname <> ALL (ARRAY['pg_catalog'::name, 'information_schema'::name]))
1105 ORDER BY pg_relation_size((c.oid)::regclass) DESC;
1106
1107
1108 ALTER TABLE relation_sizes OWNER TO pakfire;
1109
1110 --
1111 -- Name: repositories; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1112 --
1113
1114 CREATE TABLE repositories (
1115 id integer NOT NULL,
1116 name text NOT NULL,
1117 type text DEFAULT 'testing'::text NOT NULL,
1118 description text NOT NULL,
1119 distro_id integer NOT NULL,
1120 parent_id integer,
1121 key_id integer,
1122 mirrored boolean DEFAULT false NOT NULL,
1123 enabled_for_builds boolean DEFAULT false NOT NULL,
1124 score_needed integer DEFAULT 0 NOT NULL,
1125 last_update timestamp without time zone,
1126 time_min integer DEFAULT 0 NOT NULL,
1127 time_max integer DEFAULT 0 NOT NULL,
1128 deleted boolean DEFAULT false NOT NULL,
1129 priority integer,
1130 user_id integer,
1131 update_forced boolean DEFAULT false NOT NULL
1132 );
1133
1134
1135 ALTER TABLE repositories OWNER TO pakfire;
1136
1137 --
1138 -- Name: repositories_aux; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1139 --
1140
1141 CREATE TABLE repositories_aux (
1142 id integer NOT NULL,
1143 name text NOT NULL,
1144 description text,
1145 url text NOT NULL,
1146 distro_id integer NOT NULL,
1147 status text DEFAULT 'disabled'::text NOT NULL
1148 );
1149
1150
1151 ALTER TABLE repositories_aux OWNER TO pakfire;
1152
1153 --
1154 -- Name: repositories_aux_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1155 --
1156
1157 CREATE SEQUENCE repositories_aux_id_seq
1158 START WITH 1
1159 INCREMENT BY 1
1160 NO MINVALUE
1161 NO MAXVALUE
1162 CACHE 1;
1163
1164
1165 ALTER TABLE repositories_aux_id_seq OWNER TO pakfire;
1166
1167 --
1168 -- Name: repositories_aux_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1169 --
1170
1171 ALTER SEQUENCE repositories_aux_id_seq OWNED BY repositories_aux.id;
1172
1173
1174 --
1175 -- Name: repositories_builds; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1176 --
1177
1178 CREATE TABLE repositories_builds (
1179 id integer NOT NULL,
1180 repo_id integer NOT NULL,
1181 build_id bigint NOT NULL,
1182 time_added timestamp without time zone NOT NULL
1183 );
1184
1185
1186 ALTER TABLE repositories_builds OWNER TO pakfire;
1187
1188 --
1189 -- Name: repositories_builds_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1190 --
1191
1192 CREATE SEQUENCE repositories_builds_id_seq
1193 START WITH 1
1194 INCREMENT BY 1
1195 NO MINVALUE
1196 NO MAXVALUE
1197 CACHE 1;
1198
1199
1200 ALTER TABLE repositories_builds_id_seq OWNER TO pakfire;
1201
1202 --
1203 -- Name: repositories_builds_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1204 --
1205
1206 ALTER SEQUENCE repositories_builds_id_seq OWNED BY repositories_builds.id;
1207
1208
1209 --
1210 -- Name: repositories_history; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1211 --
1212
1213 CREATE TABLE repositories_history (
1214 build_id bigint NOT NULL,
1215 action text NOT NULL,
1216 from_repo_id integer,
1217 to_repo_id integer,
1218 user_id integer,
1219 "time" timestamp without time zone NOT NULL
1220 );
1221
1222
1223 ALTER TABLE repositories_history OWNER TO pakfire;
1224
1225 --
1226 -- Name: repositories_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1227 --
1228
1229 CREATE SEQUENCE repositories_id_seq
1230 START WITH 1
1231 INCREMENT BY 1
1232 NO MINVALUE
1233 NO MAXVALUE
1234 CACHE 1;
1235
1236
1237 ALTER TABLE repositories_id_seq OWNER TO pakfire;
1238
1239 --
1240 -- Name: repositories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1241 --
1242
1243 ALTER SEQUENCE repositories_id_seq OWNED BY repositories.id;
1244
1245
1246 --
1247 -- Name: sessions; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1248 --
1249
1250 CREATE TABLE sessions (
1251 id integer NOT NULL,
1252 session_id text NOT NULL,
1253 created_at timestamp without time zone DEFAULT now() NOT NULL,
1254 valid_until timestamp without time zone DEFAULT (now() + '7 days'::interval) NOT NULL,
1255 user_id integer NOT NULL,
1256 impersonated_user_id integer,
1257 address inet,
1258 user_agent text,
1259 CONSTRAINT sessions_impersonation_check CHECK (((impersonated_user_id IS NULL) OR (user_id <> impersonated_user_id)))
1260 );
1261
1262
1263 ALTER TABLE sessions OWNER TO pakfire;
1264
1265 --
1266 -- Name: sessions_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1267 --
1268
1269 CREATE SEQUENCE sessions_id_seq
1270 START WITH 1
1271 INCREMENT BY 1
1272 NO MINVALUE
1273 NO MAXVALUE
1274 CACHE 1;
1275
1276
1277 ALTER TABLE sessions_id_seq OWNER TO pakfire;
1278
1279 --
1280 -- Name: sessions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1281 --
1282
1283 ALTER SEQUENCE sessions_id_seq OWNED BY sessions.id;
1284
1285
1286 --
1287 -- Name: settings; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1288 --
1289
1290 CREATE TABLE settings (
1291 k text NOT NULL,
1292 v text NOT NULL
1293 );
1294
1295
1296 ALTER TABLE settings OWNER TO pakfire;
1297
1298 --
1299 -- Name: sources; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1300 --
1301
1302 CREATE TABLE sources (
1303 id integer NOT NULL,
1304 name text NOT NULL,
1305 identifier text NOT NULL,
1306 url text NOT NULL,
1307 gitweb text,
1308 revision text NOT NULL,
1309 branch text NOT NULL,
1310 updated timestamp without time zone,
1311 distro_id integer NOT NULL
1312 );
1313
1314
1315 ALTER TABLE sources OWNER TO pakfire;
1316
1317 --
1318 -- Name: sources_commits; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1319 --
1320
1321 CREATE TABLE sources_commits (
1322 id integer NOT NULL,
1323 source_id integer NOT NULL,
1324 revision text NOT NULL,
1325 author text NOT NULL,
1326 committer text NOT NULL,
1327 subject text NOT NULL,
1328 body text NOT NULL,
1329 date timestamp without time zone NOT NULL,
1330 state text DEFAULT 'pending'::text NOT NULL,
1331 imported_at timestamp without time zone DEFAULT now() NOT NULL
1332 );
1333
1334
1335 ALTER TABLE sources_commits OWNER TO pakfire;
1336
1337 --
1338 -- Name: sources_commits_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1339 --
1340
1341 CREATE SEQUENCE sources_commits_id_seq
1342 START WITH 1
1343 INCREMENT BY 1
1344 NO MINVALUE
1345 NO MAXVALUE
1346 CACHE 1;
1347
1348
1349 ALTER TABLE sources_commits_id_seq OWNER TO pakfire;
1350
1351 --
1352 -- Name: sources_commits_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1353 --
1354
1355 ALTER SEQUENCE sources_commits_id_seq OWNED BY sources_commits.id;
1356
1357
1358 --
1359 -- Name: sources_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1360 --
1361
1362 CREATE SEQUENCE sources_id_seq
1363 START WITH 1
1364 INCREMENT BY 1
1365 NO MINVALUE
1366 NO MAXVALUE
1367 CACHE 1;
1368
1369
1370 ALTER TABLE sources_id_seq OWNER TO pakfire;
1371
1372 --
1373 -- Name: sources_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1374 --
1375
1376 ALTER SEQUENCE sources_id_seq OWNED BY sources.id;
1377
1378
1379 --
1380 -- Name: uploads; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1381 --
1382
1383 CREATE TABLE uploads (
1384 id integer NOT NULL,
1385 uuid text NOT NULL,
1386 user_id integer,
1387 builder_id integer,
1388 filename text NOT NULL,
1389 hash text,
1390 size bigint NOT NULL,
1391 progress bigint DEFAULT 0 NOT NULL,
1392 finished boolean DEFAULT false NOT NULL,
1393 time_started timestamp without time zone DEFAULT now() NOT NULL,
1394 time_finished timestamp without time zone
1395 );
1396
1397
1398 ALTER TABLE uploads OWNER TO pakfire;
1399
1400 --
1401 -- Name: uploads_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1402 --
1403
1404 CREATE SEQUENCE uploads_id_seq
1405 START WITH 1
1406 INCREMENT BY 1
1407 NO MINVALUE
1408 NO MAXVALUE
1409 CACHE 1;
1410
1411
1412 ALTER TABLE uploads_id_seq OWNER TO pakfire;
1413
1414 --
1415 -- Name: uploads_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1416 --
1417
1418 ALTER SEQUENCE uploads_id_seq OWNED BY uploads.id;
1419
1420
1421 --
1422 -- Name: users; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1423 --
1424
1425 CREATE TABLE users (
1426 id integer NOT NULL,
1427 name text NOT NULL,
1428 realname text,
1429 passphrase text,
1430 locale text,
1431 timezone text,
1432 activated boolean DEFAULT false NOT NULL,
1433 deleted boolean DEFAULT false NOT NULL,
1434 registered_at timestamp without time zone DEFAULT now() NOT NULL,
1435 ldap_dn text,
1436 password_recovery_code text,
1437 password_recovery_code_expires_at timestamp without time zone,
1438 admin boolean DEFAULT false NOT NULL
1439 );
1440
1441
1442 ALTER TABLE users OWNER TO pakfire;
1443
1444 --
1445 -- Name: users_emails; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1446 --
1447
1448 CREATE TABLE users_emails (
1449 id integer NOT NULL,
1450 user_id integer NOT NULL,
1451 email text NOT NULL,
1452 "primary" boolean DEFAULT false NOT NULL,
1453 activated boolean DEFAULT false NOT NULL,
1454 activation_code text
1455 );
1456
1457
1458 ALTER TABLE users_emails OWNER TO pakfire;
1459
1460 --
1461 -- Name: users_emails_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1462 --
1463
1464 CREATE SEQUENCE users_emails_id_seq
1465 START WITH 1
1466 INCREMENT BY 1
1467 NO MINVALUE
1468 NO MAXVALUE
1469 CACHE 1;
1470
1471
1472 ALTER TABLE users_emails_id_seq OWNER TO pakfire;
1473
1474 --
1475 -- Name: users_emails_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1476 --
1477
1478 ALTER SEQUENCE users_emails_id_seq OWNED BY users_emails.id;
1479
1480
1481 --
1482 -- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1483 --
1484
1485 CREATE SEQUENCE users_id_seq
1486 START WITH 1
1487 INCREMENT BY 1
1488 NO MINVALUE
1489 NO MAXVALUE
1490 CACHE 1;
1491
1492
1493 ALTER TABLE users_id_seq OWNER TO pakfire;
1494
1495 --
1496 -- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1497 --
1498
1499 ALTER SEQUENCE users_id_seq OWNED BY users.id;
1500
1501
1502 --
1503 -- Name: users_permissions; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1504 --
1505
1506 CREATE TABLE users_permissions (
1507 id integer NOT NULL,
1508 user_id integer NOT NULL,
1509 create_scratch_builds boolean DEFAULT false NOT NULL,
1510 maintain_builders boolean DEFAULT false NOT NULL,
1511 manage_critical_path boolean DEFAULT false NOT NULL,
1512 manage_mirrors boolean DEFAULT false NOT NULL,
1513 vote boolean DEFAULT false NOT NULL
1514 );
1515
1516
1517 ALTER TABLE users_permissions OWNER TO pakfire;
1518
1519 --
1520 -- Name: users_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1521 --
1522
1523 CREATE SEQUENCE users_permissions_id_seq
1524 START WITH 1
1525 INCREMENT BY 1
1526 NO MINVALUE
1527 NO MAXVALUE
1528 CACHE 1;
1529
1530
1531 ALTER TABLE users_permissions_id_seq OWNER TO pakfire;
1532
1533 --
1534 -- Name: users_permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1535 --
1536
1537 ALTER SEQUENCE users_permissions_id_seq OWNED BY users_permissions.id;
1538
1539
1540 --
1541 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1542 --
1543
1544 ALTER TABLE ONLY arches ALTER COLUMN id SET DEFAULT nextval('arches_id_seq'::regclass);
1545
1546
1547 --
1548 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1549 --
1550
1551 ALTER TABLE ONLY builders ALTER COLUMN id SET DEFAULT nextval('builders_id_seq'::regclass);
1552
1553
1554 --
1555 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1556 --
1557
1558 ALTER TABLE ONLY builders_history ALTER COLUMN id SET DEFAULT nextval('builders_history_id_seq'::regclass);
1559
1560
1561 --
1562 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1563 --
1564
1565 ALTER TABLE ONLY builds ALTER COLUMN id SET DEFAULT nextval('builds_id_seq'::regclass);
1566
1567
1568 --
1569 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1570 --
1571
1572 ALTER TABLE ONLY builds_bugs ALTER COLUMN id SET DEFAULT nextval('builds_bugs_id_seq'::regclass);
1573
1574
1575 --
1576 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1577 --
1578
1579 ALTER TABLE ONLY builds_bugs_updates ALTER COLUMN id SET DEFAULT nextval('builds_bugs_updates_id_seq'::regclass);
1580
1581
1582 --
1583 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1584 --
1585
1586 ALTER TABLE ONLY builds_comments ALTER COLUMN id SET DEFAULT nextval('builds_comments_id_seq'::regclass);
1587
1588
1589 --
1590 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1591 --
1592
1593 ALTER TABLE ONLY builds_history ALTER COLUMN id SET DEFAULT nextval('builds_history_id_seq'::regclass);
1594
1595
1596 --
1597 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1598 --
1599
1600 ALTER TABLE ONLY builds_watchers ALTER COLUMN id SET DEFAULT nextval('builds_watchers_id_seq'::regclass);
1601
1602
1603 --
1604 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1605 --
1606
1607 ALTER TABLE ONLY distributions ALTER COLUMN id SET DEFAULT nextval('distributions_id_seq'::regclass);
1608
1609
1610 --
1611 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1612 --
1613
1614 ALTER TABLE ONLY distributions_arches ALTER COLUMN id SET DEFAULT nextval('distro_arches_id_seq'::regclass);
1615
1616
1617 --
1618 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1619 --
1620
1621 ALTER TABLE ONLY images_types ALTER COLUMN id SET DEFAULT nextval('images_types_id_seq'::regclass);
1622
1623
1624 --
1625 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1626 --
1627
1628 ALTER TABLE ONLY jobs ALTER COLUMN id SET DEFAULT nextval('jobs_id_seq'::regclass);
1629
1630
1631 --
1632 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1633 --
1634
1635 ALTER TABLE ONLY jobs_packages ALTER COLUMN id SET DEFAULT nextval('jobs_packages_id_seq'::regclass);
1636
1637
1638 --
1639 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1640 --
1641
1642 ALTER TABLE ONLY keys ALTER COLUMN id SET DEFAULT nextval('keys_id_seq'::regclass);
1643
1644
1645 --
1646 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1647 --
1648
1649 ALTER TABLE ONLY keys_subkeys ALTER COLUMN id SET DEFAULT nextval('keys_subkeys_id_seq'::regclass);
1650
1651
1652 --
1653 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1654 --
1655
1656 ALTER TABLE ONLY logfiles ALTER COLUMN id SET DEFAULT nextval('logfiles_id_seq'::regclass);
1657
1658
1659 --
1660 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1661 --
1662
1663 ALTER TABLE ONLY messages ALTER COLUMN id SET DEFAULT nextval('messages_id_seq'::regclass);
1664
1665
1666 --
1667 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1668 --
1669
1670 ALTER TABLE ONLY mirrors ALTER COLUMN id SET DEFAULT nextval('mirrors_id_seq'::regclass);
1671
1672
1673 --
1674 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1675 --
1676
1677 ALTER TABLE ONLY mirrors_checks ALTER COLUMN id SET DEFAULT nextval('mirrors_checks_id_seq'::regclass);
1678
1679
1680 --
1681 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1682 --
1683
1684 ALTER TABLE ONLY mirrors_history ALTER COLUMN id SET DEFAULT nextval('mirrors_history_id_seq'::regclass);
1685
1686
1687 --
1688 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1689 --
1690
1691 ALTER TABLE ONLY packages ALTER COLUMN id SET DEFAULT nextval('packages_id_seq'::regclass);
1692
1693
1694 --
1695 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1696 --
1697
1698 ALTER TABLE ONLY packages_properties ALTER COLUMN id SET DEFAULT nextval('packages_properties_id_seq'::regclass);
1699
1700
1701 --
1702 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1703 --
1704
1705 ALTER TABLE ONLY queue_delete ALTER COLUMN id SET DEFAULT nextval('queue_delete_id_seq'::regclass);
1706
1707
1708 --
1709 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1710 --
1711
1712 ALTER TABLE ONLY repositories ALTER COLUMN id SET DEFAULT nextval('repositories_id_seq'::regclass);
1713
1714
1715 --
1716 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1717 --
1718
1719 ALTER TABLE ONLY repositories_aux ALTER COLUMN id SET DEFAULT nextval('repositories_aux_id_seq'::regclass);
1720
1721
1722 --
1723 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1724 --
1725
1726 ALTER TABLE ONLY repositories_builds ALTER COLUMN id SET DEFAULT nextval('repositories_builds_id_seq'::regclass);
1727
1728
1729 --
1730 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1731 --
1732
1733 ALTER TABLE ONLY sessions ALTER COLUMN id SET DEFAULT nextval('sessions_id_seq'::regclass);
1734
1735
1736 --
1737 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1738 --
1739
1740 ALTER TABLE ONLY sources ALTER COLUMN id SET DEFAULT nextval('sources_id_seq'::regclass);
1741
1742
1743 --
1744 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1745 --
1746
1747 ALTER TABLE ONLY sources_commits ALTER COLUMN id SET DEFAULT nextval('sources_commits_id_seq'::regclass);
1748
1749
1750 --
1751 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1752 --
1753
1754 ALTER TABLE ONLY uploads ALTER COLUMN id SET DEFAULT nextval('uploads_id_seq'::regclass);
1755
1756
1757 --
1758 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1759 --
1760
1761 ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
1762
1763
1764 --
1765 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1766 --
1767
1768 ALTER TABLE ONLY users_emails ALTER COLUMN id SET DEFAULT nextval('users_emails_id_seq'::regclass);
1769
1770
1771 --
1772 -- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1773 --
1774
1775 ALTER TABLE ONLY users_permissions ALTER COLUMN id SET DEFAULT nextval('users_permissions_id_seq'::regclass);
1776
1777
1778 --
1779 -- Name: arches_compat_unique; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1780 --
1781
1782 ALTER TABLE ONLY arches_compat
1783 ADD CONSTRAINT arches_compat_unique UNIQUE (native_arch, build_arch);
1784
1785
1786 --
1787 -- Name: arches_name; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1788 --
1789
1790 ALTER TABLE ONLY arches
1791 ADD CONSTRAINT arches_name UNIQUE (name);
1792
1793
1794 --
1795 -- Name: idx_2197943_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1796 --
1797
1798 ALTER TABLE ONLY arches
1799 ADD CONSTRAINT idx_2197943_primary PRIMARY KEY (id);
1800
1801
1802 --
1803 -- Name: idx_2197954_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1804 --
1805
1806 ALTER TABLE ONLY builders
1807 ADD CONSTRAINT idx_2197954_primary PRIMARY KEY (id);
1808
1809
1810 --
1811 -- Name: idx_2197982_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1812 --
1813
1814 ALTER TABLE ONLY builders_history
1815 ADD CONSTRAINT idx_2197982_primary PRIMARY KEY (id);
1816
1817
1818 --
1819 -- Name: idx_2197988_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1820 --
1821
1822 ALTER TABLE ONLY builds
1823 ADD CONSTRAINT idx_2197988_primary PRIMARY KEY (id);
1824
1825
1826 --
1827 -- Name: idx_2198002_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1828 --
1829
1830 ALTER TABLE ONLY builds_bugs
1831 ADD CONSTRAINT idx_2198002_primary PRIMARY KEY (id);
1832
1833
1834 --
1835 -- Name: idx_2198008_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1836 --
1837
1838 ALTER TABLE ONLY builds_bugs_updates
1839 ADD CONSTRAINT idx_2198008_primary PRIMARY KEY (id);
1840
1841
1842 --
1843 -- Name: idx_2198018_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1844 --
1845
1846 ALTER TABLE ONLY builds_comments
1847 ADD CONSTRAINT idx_2198018_primary PRIMARY KEY (id);
1848
1849
1850 --
1851 -- Name: idx_2198027_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1852 --
1853
1854 ALTER TABLE ONLY builds_history
1855 ADD CONSTRAINT idx_2198027_primary PRIMARY KEY (id);
1856
1857
1858 --
1859 -- Name: idx_2198033_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1860 --
1861
1862 ALTER TABLE ONLY builds_watchers
1863 ADD CONSTRAINT idx_2198033_primary PRIMARY KEY (id);
1864
1865
1866 --
1867 -- Name: idx_2198039_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1868 --
1869
1870 ALTER TABLE ONLY distributions
1871 ADD CONSTRAINT idx_2198039_primary PRIMARY KEY (id);
1872
1873
1874 --
1875 -- Name: idx_2198048_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1876 --
1877
1878 ALTER TABLE ONLY distributions_arches
1879 ADD CONSTRAINT idx_2198048_primary PRIMARY KEY (id);
1880
1881
1882 --
1883 -- Name: idx_2198057_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1884 --
1885
1886 ALTER TABLE ONLY images_types
1887 ADD CONSTRAINT idx_2198057_primary PRIMARY KEY (id);
1888
1889
1890 --
1891 -- Name: idx_2198063_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1892 --
1893
1894 ALTER TABLE ONLY jobs
1895 ADD CONSTRAINT idx_2198063_primary PRIMARY KEY (id);
1896
1897
1898 --
1899 -- Name: idx_2198085_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1900 --
1901
1902 ALTER TABLE ONLY jobs_packages
1903 ADD CONSTRAINT idx_2198085_primary PRIMARY KEY (id);
1904
1905
1906 --
1907 -- Name: idx_2198094_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1908 --
1909
1910 ALTER TABLE ONLY keys
1911 ADD CONSTRAINT idx_2198094_primary PRIMARY KEY (id);
1912
1913
1914 --
1915 -- Name: idx_2198103_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1916 --
1917
1918 ALTER TABLE ONLY keys_subkeys
1919 ADD CONSTRAINT idx_2198103_primary PRIMARY KEY (id);
1920
1921
1922 --
1923 -- Name: idx_2198109_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1924 --
1925
1926 ALTER TABLE ONLY logfiles
1927 ADD CONSTRAINT idx_2198109_primary PRIMARY KEY (id);
1928
1929
1930 --
1931 -- Name: idx_2198115_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1932 --
1933
1934 ALTER TABLE ONLY mirrors
1935 ADD CONSTRAINT idx_2198115_primary PRIMARY KEY (id);
1936
1937
1938 --
1939 -- Name: idx_2198126_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1940 --
1941
1942 ALTER TABLE ONLY mirrors_history
1943 ADD CONSTRAINT idx_2198126_primary PRIMARY KEY (id);
1944
1945
1946 --
1947 -- Name: idx_2198132_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1948 --
1949
1950 ALTER TABLE ONLY packages
1951 ADD CONSTRAINT idx_2198132_primary PRIMARY KEY (id);
1952
1953
1954 --
1955 -- Name: idx_2198147_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1956 --
1957
1958 ALTER TABLE ONLY packages_properties
1959 ADD CONSTRAINT idx_2198147_primary PRIMARY KEY (id);
1960
1961
1962 --
1963 -- Name: idx_2198155_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1964 --
1965
1966 ALTER TABLE ONLY queue_delete
1967 ADD CONSTRAINT idx_2198155_primary PRIMARY KEY (id);
1968
1969
1970 --
1971 -- Name: idx_2198164_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1972 --
1973
1974 ALTER TABLE ONLY repositories
1975 ADD CONSTRAINT idx_2198164_primary PRIMARY KEY (id);
1976
1977
1978 --
1979 -- Name: idx_2198179_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1980 --
1981
1982 ALTER TABLE ONLY repositories_aux
1983 ADD CONSTRAINT idx_2198179_primary PRIMARY KEY (id);
1984
1985
1986 --
1987 -- Name: idx_2198189_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1988 --
1989
1990 ALTER TABLE ONLY repositories_builds
1991 ADD CONSTRAINT idx_2198189_primary PRIMARY KEY (id);
1992
1993
1994 --
1995 -- Name: idx_2198213_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1996 --
1997
1998 ALTER TABLE ONLY sources
1999 ADD CONSTRAINT idx_2198213_primary PRIMARY KEY (id);
2000
2001
2002 --
2003 -- Name: idx_2198222_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2004 --
2005
2006 ALTER TABLE ONLY sources_commits
2007 ADD CONSTRAINT idx_2198222_primary PRIMARY KEY (id);
2008
2009
2010 --
2011 -- Name: idx_2198232_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2012 --
2013
2014 ALTER TABLE ONLY uploads
2015 ADD CONSTRAINT idx_2198232_primary PRIMARY KEY (id);
2016
2017
2018 --
2019 -- Name: idx_2198244_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2020 --
2021
2022 ALTER TABLE ONLY users
2023 ADD CONSTRAINT idx_2198244_primary PRIMARY KEY (id);
2024
2025
2026 --
2027 -- Name: idx_2198256_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2028 --
2029
2030 ALTER TABLE ONLY users_emails
2031 ADD CONSTRAINT idx_2198256_primary PRIMARY KEY (id);
2032
2033
2034 --
2035 -- Name: idx_2198263_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2036 --
2037
2038 ALTER TABLE ONLY users_permissions
2039 ADD CONSTRAINT idx_2198263_primary PRIMARY KEY (id);
2040
2041
2042 --
2043 -- Name: idx_2198274_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2044 --
2045
2046 ALTER TABLE ONLY messages
2047 ADD CONSTRAINT idx_2198274_primary PRIMARY KEY (id);
2048
2049
2050 --
2051 -- Name: jobs_packages_unique; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2052 --
2053
2054 ALTER TABLE ONLY jobs_packages
2055 ADD CONSTRAINT jobs_packages_unique UNIQUE (job_id, pkg_id);
2056
2057
2058 --
2059 -- Name: mirrors_checks_pkey; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2060 --
2061
2062 ALTER TABLE ONLY mirrors_checks
2063 ADD CONSTRAINT mirrors_checks_pkey PRIMARY KEY (id);
2064
2065
2066 --
2067 -- Name: repositories_builds_unique; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2068 --
2069
2070 ALTER TABLE ONLY repositories_builds
2071 ADD CONSTRAINT repositories_builds_unique UNIQUE (repo_id, build_id);
2072
2073
2074 --
2075 -- Name: sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2076 --
2077
2078 ALTER TABLE ONLY sessions
2079 ADD CONSTRAINT sessions_pkey PRIMARY KEY (id);
2080
2081
2082 --
2083 -- Name: sessions_session_id_key; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2084 --
2085
2086 ALTER TABLE ONLY sessions
2087 ADD CONSTRAINT sessions_session_id_key UNIQUE (session_id);
2088
2089
2090 --
2091 -- Name: users_password_recovery_code; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2092 --
2093
2094 ALTER TABLE ONLY users
2095 ADD CONSTRAINT users_password_recovery_code UNIQUE (password_recovery_code);
2096
2097
2098 --
2099 -- Name: arches_compat_native_arch; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2100 --
2101
2102 CREATE INDEX arches_compat_native_arch ON arches_compat USING btree (native_arch);
2103
2104
2105 --
2106 -- Name: builders_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2107 --
2108
2109 CREATE UNIQUE INDEX builders_name ON builders USING btree (name) WHERE (deleted IS FALSE);
2110
2111
2112 --
2113 -- Name: builds_watchers_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2114 --
2115
2116 CREATE INDEX builds_watchers_build_id ON builds_watchers USING btree (build_id);
2117
2118
2119 --
2120 -- Name: distributions_arches_distro_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2121 --
2122
2123 CREATE INDEX distributions_arches_distro_id ON distributions_arches USING btree (distro_id);
2124
2125
2126 --
2127 -- Name: distributions_sname; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2128 --
2129
2130 CREATE UNIQUE INDEX distributions_sname ON distributions USING btree (sname) WHERE (deleted IS FALSE);
2131
2132
2133 --
2134 -- Name: filelists_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2135 --
2136
2137 CREATE INDEX filelists_name ON filelists USING btree (name);
2138
2139
2140 --
2141 -- Name: filelists_pkg_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2142 --
2143
2144 CREATE INDEX filelists_pkg_id ON filelists USING btree (pkg_id);
2145
2146 ALTER TABLE filelists CLUSTER ON filelists_pkg_id;
2147
2148
2149 --
2150 -- Name: idx_2197982_builder_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2151 --
2152
2153 CREATE INDEX idx_2197982_builder_id ON builders_history USING btree (builder_id);
2154
2155
2156 --
2157 -- Name: idx_2197988_pkg_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2158 --
2159
2160 CREATE INDEX idx_2197988_pkg_id ON builds USING btree (pkg_id);
2161
2162
2163 --
2164 -- Name: idx_2197988_state; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2165 --
2166
2167 CREATE INDEX idx_2197988_state ON builds USING btree (state);
2168
2169
2170 --
2171 -- Name: idx_2197988_type; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2172 --
2173
2174 CREATE INDEX idx_2197988_type ON builds USING btree (type);
2175
2176
2177 --
2178 -- Name: idx_2197988_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2179 --
2180
2181 CREATE UNIQUE INDEX idx_2197988_uuid ON builds USING btree (uuid);
2182
2183
2184 --
2185 -- Name: idx_2198002_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2186 --
2187
2188 CREATE UNIQUE INDEX idx_2198002_build_id ON builds_bugs USING btree (build_id, bug_id);
2189
2190
2191 --
2192 -- Name: idx_2198018_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2193 --
2194
2195 CREATE INDEX idx_2198018_build_id ON builds_comments USING btree (build_id);
2196
2197
2198 --
2199 -- Name: idx_2198018_user_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2200 --
2201
2202 CREATE INDEX idx_2198018_user_id ON builds_comments USING btree (user_id);
2203
2204
2205 --
2206 -- Name: idx_2198063_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2207 --
2208
2209 CREATE INDEX idx_2198063_build_id ON jobs USING btree (build_id);
2210
2211
2212 --
2213 -- Name: idx_2198063_state; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2214 --
2215
2216 CREATE INDEX idx_2198063_state ON jobs USING btree (state);
2217
2218
2219 --
2220 -- Name: idx_2198063_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2221 --
2222
2223 CREATE UNIQUE INDEX idx_2198063_uuid ON jobs USING btree (uuid);
2224
2225
2226 --
2227 -- Name: idx_2198080_job_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2228 --
2229
2230 CREATE INDEX idx_2198080_job_id ON jobs_history USING btree (job_id);
2231
2232
2233 --
2234 -- Name: idx_2198089_job_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2235 --
2236
2237 CREATE UNIQUE INDEX idx_2198089_job_id ON jobs_repos USING btree (job_id, repo_id);
2238
2239
2240 --
2241 -- Name: idx_2198094_fingerprint; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2242 --
2243
2244 CREATE UNIQUE INDEX idx_2198094_fingerprint ON keys USING btree (fingerprint);
2245
2246
2247 --
2248 -- Name: idx_2198132_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2249 --
2250
2251 CREATE INDEX idx_2198132_name ON packages USING btree (name);
2252
2253
2254 --
2255 -- Name: idx_2198132_type; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2256 --
2257
2258 CREATE INDEX idx_2198132_type ON packages USING btree (type);
2259
2260
2261 --
2262 -- Name: idx_2198132_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2263 --
2264
2265 CREATE INDEX idx_2198132_uuid ON packages USING btree (uuid);
2266
2267
2268 --
2269 -- Name: idx_2198139_pkg_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2270 --
2271
2272 CREATE INDEX idx_2198139_pkg_id ON packages_deps USING btree (pkg_id);
2273
2274
2275 --
2276 -- Name: idx_2198147_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2277 --
2278
2279 CREATE UNIQUE INDEX idx_2198147_name ON packages_properties USING btree (name);
2280
2281
2282 --
2283 -- Name: idx_2198189_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2284 --
2285
2286 CREATE UNIQUE INDEX idx_2198189_build_id ON repositories_builds USING btree (build_id);
2287
2288
2289 --
2290 -- Name: idx_2198193_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2291 --
2292
2293 CREATE INDEX idx_2198193_build_id ON repositories_history USING btree (build_id);
2294
2295
2296 --
2297 -- Name: idx_2198199_k; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2298 --
2299
2300 CREATE UNIQUE INDEX idx_2198199_k ON settings USING btree (k);
2301
2302
2303 --
2304 -- Name: idx_2198213_identifier; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2305 --
2306
2307 CREATE UNIQUE INDEX idx_2198213_identifier ON sources USING btree (identifier);
2308
2309
2310 --
2311 -- Name: idx_2198222_revision; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2312 --
2313
2314 CREATE INDEX idx_2198222_revision ON sources_commits USING btree (revision);
2315
2316
2317 --
2318 -- Name: idx_2198232_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2319 --
2320
2321 CREATE UNIQUE INDEX idx_2198232_uuid ON uploads USING btree (uuid);
2322
2323
2324 --
2325 -- Name: idx_2198244_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2326 --
2327
2328 CREATE UNIQUE INDEX idx_2198244_name ON users USING btree (name);
2329
2330
2331 --
2332 -- Name: idx_2198256_email; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2333 --
2334
2335 CREATE UNIQUE INDEX idx_2198256_email ON users_emails USING btree (email);
2336
2337
2338 --
2339 -- Name: idx_2198256_user_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2340 --
2341
2342 CREATE INDEX idx_2198256_user_id ON users_emails USING btree (user_id);
2343
2344
2345 --
2346 -- Name: jobs_arch; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2347 --
2348
2349 CREATE INDEX jobs_arch ON jobs USING btree (arch);
2350
2351
2352 --
2353 -- Name: jobs_builders_active_jobs; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2354 --
2355
2356 CREATE INDEX jobs_builders_active_jobs ON jobs USING btree (builder_id) WHERE (state = ANY (ARRAY['dispatching'::text, 'running'::text]));
2357
2358
2359 --
2360 -- Name: jobs_buildroots_job_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2361 --
2362
2363 CREATE INDEX jobs_buildroots_job_id ON jobs_buildroots USING btree (job_id);
2364
2365 ALTER TABLE jobs_buildroots CLUSTER ON jobs_buildroots_job_id;
2366
2367
2368 --
2369 -- Name: jobs_buildroots_pkg_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2370 --
2371
2372 CREATE INDEX jobs_buildroots_pkg_uuid ON jobs_buildroots USING btree (pkg_uuid);
2373
2374
2375 --
2376 -- Name: jobs_queue_ready; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2377 --
2378
2379 CREATE INDEX jobs_queue_ready ON jobs USING btree (id) WHERE ((state = 'new'::text) AND (dependency_check_succeeded IS TRUE));
2380
2381
2382 --
2383 -- Name: jobs_time_finished; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2384 --
2385
2386 CREATE INDEX jobs_time_finished ON jobs USING btree (time_finished DESC) WHERE (time_finished IS NOT NULL);
2387
2388
2389 --
2390 -- Name: jobs_time_started; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2391 --
2392
2393 CREATE INDEX jobs_time_started ON jobs USING btree (time_started) WHERE ((time_started IS NOT NULL) AND (time_finished IS NULL));
2394
2395
2396 --
2397 -- Name: messages_order; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2398 --
2399
2400 CREATE INDEX messages_order ON messages USING btree (queued_at) WHERE (sent_at IS NULL);
2401
2402
2403 --
2404 -- Name: mirrors_checks_sort; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2405 --
2406
2407 CREATE INDEX mirrors_checks_sort ON mirrors_checks USING btree (mirror_id, "timestamp");
2408
2409 ALTER TABLE mirrors_checks CLUSTER ON mirrors_checks_sort;
2410
2411
2412 --
2413 -- Name: repositories_builds_repo_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2414 --
2415
2416 CREATE INDEX repositories_builds_repo_id ON repositories_builds USING btree (repo_id);
2417
2418
2419 --
2420 -- Name: on_update_current_timestamp; Type: TRIGGER; Schema: public; Owner: pakfire
2421 --
2422
2423 CREATE TRIGGER on_update_current_timestamp BEFORE UPDATE ON sources FOR EACH ROW EXECUTE PROCEDURE on_update_current_timestamp_sources();
2424
2425
2426 --
2427 -- Name: arches_compat_build_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2428 --
2429
2430 ALTER TABLE ONLY arches_compat
2431 ADD CONSTRAINT arches_compat_build_arch FOREIGN KEY (build_arch) REFERENCES arches(name);
2432
2433
2434 --
2435 -- Name: builders_history_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2436 --
2437
2438 ALTER TABLE ONLY builders_history
2439 ADD CONSTRAINT builders_history_builder_id FOREIGN KEY (builder_id) REFERENCES builders(id);
2440
2441
2442 --
2443 -- Name: builders_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2444 --
2445
2446 ALTER TABLE ONLY builders_history
2447 ADD CONSTRAINT builders_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2448
2449
2450 --
2451 -- Name: builds_bug_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2452 --
2453
2454 ALTER TABLE ONLY builds_bugs
2455 ADD CONSTRAINT builds_bug_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2456
2457
2458 --
2459 -- Name: builds_comments_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2460 --
2461
2462 ALTER TABLE ONLY builds_comments
2463 ADD CONSTRAINT builds_comments_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2464
2465
2466 --
2467 -- Name: builds_comments_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2468 --
2469
2470 ALTER TABLE ONLY builds_comments
2471 ADD CONSTRAINT builds_comments_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2472
2473
2474 --
2475 -- Name: builds_depends_on; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2476 --
2477
2478 ALTER TABLE ONLY builds
2479 ADD CONSTRAINT builds_depends_on FOREIGN KEY (depends_on) REFERENCES builds(id);
2480
2481
2482 --
2483 -- Name: builds_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2484 --
2485
2486 ALTER TABLE ONLY builds
2487 ADD CONSTRAINT builds_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
2488
2489
2490 --
2491 -- Name: builds_history_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2492 --
2493
2494 ALTER TABLE ONLY builds_history
2495 ADD CONSTRAINT builds_history_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2496
2497
2498 --
2499 -- Name: builds_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2500 --
2501
2502 ALTER TABLE ONLY builds_history
2503 ADD CONSTRAINT builds_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2504
2505
2506 --
2507 -- Name: builds_owner_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2508 --
2509
2510 ALTER TABLE ONLY builds
2511 ADD CONSTRAINT builds_owner_id FOREIGN KEY (owner_id) REFERENCES users(id);
2512
2513
2514 --
2515 -- Name: builds_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2516 --
2517
2518 ALTER TABLE ONLY builds
2519 ADD CONSTRAINT builds_pkg_id FOREIGN KEY (pkg_id) REFERENCES packages(id);
2520
2521
2522 --
2523 -- Name: builds_watchers_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2524 --
2525
2526 ALTER TABLE ONLY builds_watchers
2527 ADD CONSTRAINT builds_watchers_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2528
2529
2530 --
2531 -- Name: builds_watchers_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2532 --
2533
2534 ALTER TABLE ONLY builds_watchers
2535 ADD CONSTRAINT builds_watchers_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2536
2537
2538 --
2539 -- Name: distributions_arches_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2540 --
2541
2542 ALTER TABLE ONLY distributions_arches
2543 ADD CONSTRAINT distributions_arches_arch FOREIGN KEY (arch) REFERENCES arches(name);
2544
2545
2546 --
2547 -- Name: distro_arches_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2548 --
2549
2550 ALTER TABLE ONLY distributions_arches
2551 ADD CONSTRAINT distro_arches_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
2552
2553
2554 --
2555 -- Name: filelists_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2556 --
2557
2558 ALTER TABLE ONLY filelists
2559 ADD CONSTRAINT filelists_pkg_id FOREIGN KEY (pkg_id) REFERENCES packages(id);
2560
2561
2562 --
2563 -- Name: jobs_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2564 --
2565
2566 ALTER TABLE ONLY jobs
2567 ADD CONSTRAINT jobs_arch FOREIGN KEY (arch) REFERENCES arches(name);
2568
2569
2570 --
2571 -- Name: jobs_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2572 --
2573
2574 ALTER TABLE ONLY jobs
2575 ADD CONSTRAINT jobs_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2576
2577
2578 --
2579 -- Name: jobs_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2580 --
2581
2582 ALTER TABLE ONLY jobs
2583 ADD CONSTRAINT jobs_builder_id FOREIGN KEY (builder_id) REFERENCES builders(id);
2584
2585
2586 --
2587 -- Name: jobs_buildroots_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2588 --
2589
2590 ALTER TABLE ONLY jobs_buildroots
2591 ADD CONSTRAINT jobs_buildroots_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
2592
2593
2594 --
2595 -- Name: jobs_history_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2596 --
2597
2598 ALTER TABLE ONLY jobs_history
2599 ADD CONSTRAINT jobs_history_builder_id FOREIGN KEY (builder_id) REFERENCES builders(id);
2600
2601
2602 --
2603 -- Name: jobs_history_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2604 --
2605
2606 ALTER TABLE ONLY jobs_history
2607 ADD CONSTRAINT jobs_history_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
2608
2609
2610 --
2611 -- Name: jobs_history_test_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2612 --
2613
2614 ALTER TABLE ONLY jobs_history
2615 ADD CONSTRAINT jobs_history_test_job_id FOREIGN KEY (test_job_id) REFERENCES jobs(id);
2616
2617
2618 --
2619 -- Name: jobs_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2620 --
2621
2622 ALTER TABLE ONLY jobs_history
2623 ADD CONSTRAINT jobs_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2624
2625
2626 --
2627 -- Name: jobs_packaged_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2628 --
2629
2630 ALTER TABLE ONLY jobs_packages
2631 ADD CONSTRAINT jobs_packaged_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
2632
2633
2634 --
2635 -- Name: jobs_packages_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2636 --
2637
2638 ALTER TABLE ONLY jobs_packages
2639 ADD CONSTRAINT jobs_packages_pkg_id FOREIGN KEY (pkg_id) REFERENCES packages(id);
2640
2641
2642 --
2643 -- Name: jobs_repos_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2644 --
2645
2646 ALTER TABLE ONLY jobs_repos
2647 ADD CONSTRAINT jobs_repos_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
2648
2649
2650 --
2651 -- Name: jobs_repos_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2652 --
2653
2654 ALTER TABLE ONLY jobs_repos
2655 ADD CONSTRAINT jobs_repos_repo_id FOREIGN KEY (repo_id) REFERENCES repositories(id);
2656
2657
2658 --
2659 -- Name: jobs_superseeded_by; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2660 --
2661
2662 ALTER TABLE ONLY jobs
2663 ADD CONSTRAINT jobs_superseeded_by FOREIGN KEY (superseeded_by) REFERENCES jobs(id);
2664
2665
2666 --
2667 -- Name: keys_subkeys_key_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2668 --
2669
2670 ALTER TABLE ONLY keys_subkeys
2671 ADD CONSTRAINT keys_subkeys_key_id FOREIGN KEY (key_id) REFERENCES keys(id);
2672
2673
2674 --
2675 -- Name: logfiles_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2676 --
2677
2678 ALTER TABLE ONLY logfiles
2679 ADD CONSTRAINT logfiles_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
2680
2681
2682 --
2683 -- Name: mirrors_checks_mirror_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2684 --
2685
2686 ALTER TABLE ONLY mirrors_checks
2687 ADD CONSTRAINT mirrors_checks_mirror_id FOREIGN KEY (mirror_id) REFERENCES mirrors(id);
2688
2689
2690 --
2691 -- Name: mirrors_history_mirror_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2692 --
2693
2694 ALTER TABLE ONLY mirrors_history
2695 ADD CONSTRAINT mirrors_history_mirror_id FOREIGN KEY (mirror_id) REFERENCES mirrors(id);
2696
2697
2698 --
2699 -- Name: mirrors_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2700 --
2701
2702 ALTER TABLE ONLY mirrors_history
2703 ADD CONSTRAINT mirrors_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2704
2705
2706 --
2707 -- Name: packages_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2708 --
2709
2710 ALTER TABLE ONLY packages
2711 ADD CONSTRAINT packages_arch FOREIGN KEY (arch) REFERENCES arches(name);
2712
2713
2714 --
2715 -- Name: packages_commit_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2716 --
2717
2718 ALTER TABLE ONLY packages
2719 ADD CONSTRAINT packages_commit_id FOREIGN KEY (commit_id) REFERENCES sources_commits(id);
2720
2721
2722 --
2723 -- Name: packages_deps_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2724 --
2725
2726 ALTER TABLE ONLY packages_deps
2727 ADD CONSTRAINT packages_deps_pkg_id FOREIGN KEY (pkg_id) REFERENCES packages(id);
2728
2729
2730 --
2731 -- Name: repositories_aux_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2732 --
2733
2734 ALTER TABLE ONLY repositories_aux
2735 ADD CONSTRAINT repositories_aux_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
2736
2737
2738 --
2739 -- Name: repositories_builds_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2740 --
2741
2742 ALTER TABLE ONLY repositories_builds
2743 ADD CONSTRAINT repositories_builds_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2744
2745
2746 --
2747 -- Name: repositories_builds_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2748 --
2749
2750 ALTER TABLE ONLY repositories_builds
2751 ADD CONSTRAINT repositories_builds_repo_id FOREIGN KEY (repo_id) REFERENCES repositories(id);
2752
2753
2754 --
2755 -- Name: repositories_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2756 --
2757
2758 ALTER TABLE ONLY repositories
2759 ADD CONSTRAINT repositories_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
2760
2761
2762 --
2763 -- Name: repositories_history_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2764 --
2765
2766 ALTER TABLE ONLY repositories_history
2767 ADD CONSTRAINT repositories_history_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2768
2769
2770 --
2771 -- Name: repositories_history_from_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2772 --
2773
2774 ALTER TABLE ONLY repositories_history
2775 ADD CONSTRAINT repositories_history_from_repo_id FOREIGN KEY (from_repo_id) REFERENCES repositories(id);
2776
2777
2778 --
2779 -- Name: repositories_history_to_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2780 --
2781
2782 ALTER TABLE ONLY repositories_history
2783 ADD CONSTRAINT repositories_history_to_repo_id FOREIGN KEY (to_repo_id) REFERENCES repositories(id);
2784
2785
2786 --
2787 -- Name: repositories_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2788 --
2789
2790 ALTER TABLE ONLY repositories_history
2791 ADD CONSTRAINT repositories_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2792
2793
2794 --
2795 -- Name: repositories_key_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2796 --
2797
2798 ALTER TABLE ONLY repositories
2799 ADD CONSTRAINT repositories_key_id FOREIGN KEY (key_id) REFERENCES keys(id);
2800
2801
2802 --
2803 -- Name: repositories_parent_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2804 --
2805
2806 ALTER TABLE ONLY repositories
2807 ADD CONSTRAINT repositories_parent_id FOREIGN KEY (parent_id) REFERENCES repositories(id);
2808
2809
2810 --
2811 -- Name: repositories_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2812 --
2813
2814 ALTER TABLE ONLY repositories
2815 ADD CONSTRAINT repositories_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2816
2817
2818 --
2819 -- Name: sessions_impersonated_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2820 --
2821
2822 ALTER TABLE ONLY sessions
2823 ADD CONSTRAINT sessions_impersonated_user_id FOREIGN KEY (impersonated_user_id) REFERENCES users(id);
2824
2825
2826 --
2827 -- Name: sessions_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2828 --
2829
2830 ALTER TABLE ONLY sessions
2831 ADD CONSTRAINT sessions_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2832
2833
2834 --
2835 -- Name: sources_commits_source_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2836 --
2837
2838 ALTER TABLE ONLY sources_commits
2839 ADD CONSTRAINT sources_commits_source_id FOREIGN KEY (source_id) REFERENCES sources(id);
2840
2841
2842 --
2843 -- Name: sources_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2844 --
2845
2846 ALTER TABLE ONLY sources
2847 ADD CONSTRAINT sources_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
2848
2849
2850 --
2851 -- Name: uploads_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2852 --
2853
2854 ALTER TABLE ONLY uploads
2855 ADD CONSTRAINT uploads_builder_id FOREIGN KEY (builder_id) REFERENCES builders(id);
2856
2857
2858 --
2859 -- Name: uploads_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2860 --
2861
2862 ALTER TABLE ONLY uploads
2863 ADD CONSTRAINT uploads_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2864
2865
2866 --
2867 -- Name: users_emails_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2868 --
2869
2870 ALTER TABLE ONLY users_emails
2871 ADD CONSTRAINT users_emails_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
2872
2873
2874 --
2875 -- Name: users_permissions_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2876 --
2877
2878 ALTER TABLE ONLY users_permissions
2879 ADD CONSTRAINT users_permissions_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
2880
2881
2882 --
2883 -- PostgreSQL database dump complete
2884 --
2885