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