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