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