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