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