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