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