]> git.ipfire.org Git - pbs.git/blame - src/database.sql
jobs: Remove the magic when state is set and replace it by proper functions that...
[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,
603 CONSTRAINT jobs_states CHECK ((state = ANY (ARRAY['pending'::text, 'running'::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)))
e0e14322 880 WHERE ((jobs.state = 'new'::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
1009--
1010-- Name: mirrors; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1011--
1012
1013CREATE TABLE mirrors (
f835411e
MT
1014 id integer NOT NULL,
1015 hostname text NOT NULL,
1016 path text NOT NULL,
1017 owner text,
1018 contact text,
3163c789
MT
1019 deleted boolean DEFAULT false NOT NULL,
1020 supports_https boolean DEFAULT false NOT NULL
64316541
MT
1021);
1022
1023
1024ALTER TABLE mirrors OWNER TO pakfire;
1025
c660ff59
MT
1026--
1027-- Name: mirrors_checks; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1028--
1029
1030CREATE TABLE mirrors_checks (
1031 id integer NOT NULL,
1032 mirror_id integer NOT NULL,
1033 "timestamp" timestamp without time zone DEFAULT now() NOT NULL,
1034 response_time double precision,
1035 http_status integer,
1036 last_sync_at timestamp without time zone,
1037 status text DEFAULT 'OK'::text NOT NULL
1038);
1039
1040
1041ALTER TABLE mirrors_checks OWNER TO pakfire;
1042
1043--
1044-- Name: mirrors_checks_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1045--
1046
1047CREATE SEQUENCE mirrors_checks_id_seq
1048 START WITH 1
1049 INCREMENT BY 1
1050 NO MINVALUE
1051 NO MAXVALUE
1052 CACHE 1;
1053
1054
1055ALTER TABLE mirrors_checks_id_seq OWNER TO pakfire;
1056
1057--
1058-- Name: mirrors_checks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1059--
1060
1061ALTER SEQUENCE mirrors_checks_id_seq OWNED BY mirrors_checks.id;
1062
1063
64316541
MT
1064--
1065-- Name: mirrors_history; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1066--
1067
1068CREATE TABLE mirrors_history (
f835411e
MT
1069 id integer NOT NULL,
1070 mirror_id integer NOT NULL,
64316541 1071 action mirrors_history_action NOT NULL,
f835411e
MT
1072 user_id integer,
1073 "time" timestamp without time zone NOT NULL
64316541
MT
1074);
1075
1076
1077ALTER TABLE mirrors_history OWNER TO pakfire;
1078
1079--
1080-- Name: mirrors_history_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1081--
1082
1083CREATE SEQUENCE mirrors_history_id_seq
1084 START WITH 1
1085 INCREMENT BY 1
1086 NO MINVALUE
1087 NO MAXVALUE
1088 CACHE 1;
1089
1090
1091ALTER TABLE mirrors_history_id_seq OWNER TO pakfire;
1092
1093--
1094-- Name: mirrors_history_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1095--
1096
1097ALTER SEQUENCE mirrors_history_id_seq OWNED BY mirrors_history.id;
1098
1099
1100--
1101-- Name: mirrors_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1102--
1103
1104CREATE SEQUENCE mirrors_id_seq
1105 START WITH 1
1106 INCREMENT BY 1
1107 NO MINVALUE
1108 NO MAXVALUE
1109 CACHE 1;
1110
1111
1112ALTER TABLE mirrors_id_seq OWNER TO pakfire;
1113
1114--
1115-- Name: mirrors_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1116--
1117
1118ALTER SEQUENCE mirrors_id_seq OWNED BY mirrors.id;
1119
1120
cb866740
MT
1121--
1122-- Name: packages; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1123--
1124
1125CREATE TABLE packages (
1126 id integer NOT NULL,
1127 name text NOT NULL,
1128 epoch integer NOT NULL,
1129 version text NOT NULL,
1130 release text NOT NULL,
1131 type packages_type NOT NULL,
1132 arch text NOT NULL,
1133 groups text NOT NULL,
1134 maintainer text NOT NULL,
1135 license text NOT NULL,
1136 url text NOT NULL,
1137 summary text NOT NULL,
1138 description text NOT NULL,
1139 size bigint NOT NULL,
1140 supported_arches text,
1141 uuid text NOT NULL,
1142 commit_id integer,
1143 build_id text NOT NULL,
1144 build_host text NOT NULL,
1145 build_time timestamp without time zone NOT NULL,
1146 path text NOT NULL,
1147 filesize bigint NOT NULL,
1148 hash_sha512 text NOT NULL
1149);
1150
1151
1152ALTER TABLE packages OWNER TO pakfire;
1153
64316541
MT
1154--
1155-- Name: packages_deps; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1156--
1157
1158CREATE TABLE packages_deps (
f835411e 1159 pkg_id integer NOT NULL,
64316541 1160 type packages_deps_type NOT NULL,
f835411e 1161 what text NOT NULL
64316541
MT
1162);
1163
1164
1165ALTER TABLE packages_deps OWNER TO pakfire;
1166
1167--
1168-- Name: packages_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1169--
1170
1171CREATE SEQUENCE packages_id_seq
1172 START WITH 1
1173 INCREMENT BY 1
1174 NO MINVALUE
1175 NO MAXVALUE
1176 CACHE 1;
1177
1178
1179ALTER TABLE packages_id_seq OWNER TO pakfire;
1180
1181--
1182-- Name: packages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1183--
1184
1185ALTER SEQUENCE packages_id_seq OWNED BY packages.id;
1186
1187
1188--
1189-- Name: packages_properties; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1190--
1191
1192CREATE TABLE packages_properties (
f835411e
MT
1193 id integer NOT NULL,
1194 name text NOT NULL,
024d6076 1195 critical_path boolean DEFAULT false NOT NULL,
f835411e 1196 priority integer DEFAULT 0 NOT NULL
64316541
MT
1197);
1198
1199
1200ALTER TABLE packages_properties OWNER TO pakfire;
1201
1202--
1203-- Name: packages_properties_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1204--
1205
1206CREATE SEQUENCE packages_properties_id_seq
1207 START WITH 1
1208 INCREMENT BY 1
1209 NO MINVALUE
1210 NO MAXVALUE
1211 CACHE 1;
1212
1213
1214ALTER TABLE packages_properties_id_seq OWNER TO pakfire;
1215
1216--
1217-- Name: packages_properties_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1218--
1219
1220ALTER SEQUENCE packages_properties_id_seq OWNED BY packages_properties.id;
1221
1222
1223--
1224-- Name: queue_delete; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1225--
1226
1227CREATE TABLE queue_delete (
f835411e 1228 id integer NOT NULL,
5c9daa86
MT
1229 path text NOT NULL,
1230 not_before timestamp without time zone
64316541
MT
1231);
1232
1233
1234ALTER TABLE queue_delete OWNER TO pakfire;
1235
1236--
1237-- Name: queue_delete_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1238--
1239
1240CREATE SEQUENCE queue_delete_id_seq
1241 START WITH 1
1242 INCREMENT BY 1
1243 NO MINVALUE
1244 NO MAXVALUE
1245 CACHE 1;
1246
1247
1248ALTER TABLE queue_delete_id_seq OWNER TO pakfire;
1249
1250--
1251-- Name: queue_delete_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1252--
1253
1254ALTER SEQUENCE queue_delete_id_seq OWNED BY queue_delete.id;
1255
1256
57e6621b
MT
1257--
1258-- Name: relation_sizes; Type: VIEW; Schema: public; Owner: pakfire
1259--
1260
1261CREATE VIEW relation_sizes AS
1262 SELECT c.relname AS relation,
1263 pg_size_pretty(pg_relation_size((c.oid)::regclass)) AS size
1264 FROM (pg_class c
1265 LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace)))
1266 WHERE (n.nspname <> ALL (ARRAY['pg_catalog'::name, 'information_schema'::name]))
1267 ORDER BY pg_relation_size((c.oid)::regclass) DESC;
1268
1269
1270ALTER TABLE relation_sizes OWNER TO pakfire;
1271
64316541
MT
1272--
1273-- Name: repositories; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1274--
1275
1276CREATE TABLE repositories (
f835411e
MT
1277 id integer NOT NULL,
1278 name text NOT NULL,
64316541
MT
1279 type repositories_type DEFAULT 'testing'::repositories_type NOT NULL,
1280 description text NOT NULL,
f835411e
MT
1281 distro_id integer NOT NULL,
1282 parent_id integer,
1283 key_id integer,
fe47bbac
MT
1284 mirrored boolean DEFAULT false NOT NULL,
1285 enabled_for_builds boolean DEFAULT false NOT NULL,
f835411e
MT
1286 score_needed integer DEFAULT 0 NOT NULL,
1287 last_update timestamp without time zone,
1288 time_min integer DEFAULT 0 NOT NULL,
1289 time_max integer DEFAULT 0 NOT NULL,
5bc58fba 1290 deleted boolean DEFAULT false NOT NULL,
a7a18be1 1291 priority integer,
e67c0fc7
MT
1292 user_id integer,
1293 update_forced boolean DEFAULT false NOT NULL
64316541
MT
1294);
1295
1296
1297ALTER TABLE repositories OWNER TO pakfire;
1298
1299--
1300-- Name: repositories_aux; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1301--
1302
1303CREATE TABLE repositories_aux (
f835411e
MT
1304 id integer NOT NULL,
1305 name text NOT NULL,
64316541 1306 description text,
f835411e
MT
1307 url text NOT NULL,
1308 distro_id integer NOT NULL,
64316541
MT
1309 status repositories_aux_status DEFAULT 'disabled'::repositories_aux_status NOT NULL
1310);
1311
1312
1313ALTER TABLE repositories_aux OWNER TO pakfire;
1314
1315--
1316-- Name: repositories_aux_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1317--
1318
1319CREATE SEQUENCE repositories_aux_id_seq
1320 START WITH 1
1321 INCREMENT BY 1
1322 NO MINVALUE
1323 NO MAXVALUE
1324 CACHE 1;
1325
1326
1327ALTER TABLE repositories_aux_id_seq OWNER TO pakfire;
1328
1329--
1330-- Name: repositories_aux_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1331--
1332
1333ALTER SEQUENCE repositories_aux_id_seq OWNED BY repositories_aux.id;
1334
1335
cb866740
MT
1336--
1337-- Name: repositories_builds; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1338--
1339
1340CREATE TABLE repositories_builds (
1341 id integer NOT NULL,
1342 repo_id integer NOT NULL,
1343 build_id bigint NOT NULL,
1344 time_added timestamp without time zone NOT NULL
1345);
1346
1347
1348ALTER TABLE repositories_builds OWNER TO pakfire;
1349
64316541
MT
1350--
1351-- Name: repositories_builds_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1352--
1353
1354CREATE SEQUENCE repositories_builds_id_seq
1355 START WITH 1
1356 INCREMENT BY 1
1357 NO MINVALUE
1358 NO MAXVALUE
1359 CACHE 1;
1360
1361
1362ALTER TABLE repositories_builds_id_seq OWNER TO pakfire;
1363
1364--
1365-- Name: repositories_builds_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1366--
1367
1368ALTER SEQUENCE repositories_builds_id_seq OWNED BY repositories_builds.id;
1369
1370
1371--
1372-- Name: repositories_history; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1373--
1374
1375CREATE TABLE repositories_history (
1376 build_id bigint NOT NULL,
1377 action repositories_history_action NOT NULL,
f835411e
MT
1378 from_repo_id integer,
1379 to_repo_id integer,
1380 user_id integer,
1381 "time" timestamp without time zone NOT NULL
64316541
MT
1382);
1383
1384
1385ALTER TABLE repositories_history OWNER TO pakfire;
1386
1387--
1388-- Name: repositories_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1389--
1390
1391CREATE SEQUENCE repositories_id_seq
1392 START WITH 1
1393 INCREMENT BY 1
1394 NO MINVALUE
1395 NO MAXVALUE
1396 CACHE 1;
1397
1398
1399ALTER TABLE repositories_id_seq OWNER TO pakfire;
1400
1401--
1402-- Name: repositories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1403--
1404
1405ALTER SEQUENCE repositories_id_seq OWNED BY repositories.id;
1406
1407
1408--
1409-- Name: sessions; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1410--
1411
1412CREATE TABLE sessions (
d2738057 1413 id integer NOT NULL,
f835411e 1414 session_id text NOT NULL,
d2738057
MT
1415 created_at timestamp without time zone DEFAULT now() NOT NULL,
1416 valid_until timestamp without time zone DEFAULT (now() + '7 days'::interval) NOT NULL,
f835411e
MT
1417 user_id integer NOT NULL,
1418 impersonated_user_id integer,
d2738057
MT
1419 address inet,
1420 user_agent text,
1421 CONSTRAINT sessions_impersonation_check CHECK (((impersonated_user_id IS NULL) OR (user_id <> impersonated_user_id)))
64316541
MT
1422);
1423
1424
1425ALTER TABLE sessions OWNER TO pakfire;
1426
d2738057
MT
1427--
1428-- Name: sessions_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1429--
1430
1431CREATE SEQUENCE sessions_id_seq
1432 START WITH 1
1433 INCREMENT BY 1
1434 NO MINVALUE
1435 NO MAXVALUE
1436 CACHE 1;
1437
1438
1439ALTER TABLE sessions_id_seq OWNER TO pakfire;
1440
1441--
1442-- Name: sessions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1443--
1444
1445ALTER SEQUENCE sessions_id_seq OWNED BY sessions.id;
1446
1447
64316541
MT
1448--
1449-- Name: settings; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1450--
1451
1452CREATE TABLE settings (
f835411e
MT
1453 k text NOT NULL,
1454 v text NOT NULL
64316541
MT
1455);
1456
1457
1458ALTER TABLE settings OWNER TO pakfire;
1459
64316541
MT
1460--
1461-- Name: sources; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1462--
1463
1464CREATE TABLE sources (
f835411e
MT
1465 id integer NOT NULL,
1466 name text NOT NULL,
1467 identifier text NOT NULL,
1468 url text NOT NULL,
1469 gitweb text,
1470 revision text NOT NULL,
1471 branch text NOT NULL,
1472 updated timestamp without time zone,
1473 distro_id integer NOT NULL
64316541
MT
1474);
1475
1476
1477ALTER TABLE sources OWNER TO pakfire;
1478
1479--
1480-- Name: sources_commits; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1481--
1482
1483CREATE TABLE sources_commits (
f835411e
MT
1484 id integer NOT NULL,
1485 source_id integer NOT NULL,
1486 revision text NOT NULL,
1487 author text NOT NULL,
1488 committer text NOT NULL,
1489 subject text NOT NULL,
64316541 1490 body text NOT NULL,
f835411e 1491 date timestamp without time zone NOT NULL,
cb866740
MT
1492 state sources_commits_state DEFAULT 'pending'::sources_commits_state NOT NULL,
1493 imported_at timestamp without time zone DEFAULT now() NOT NULL
64316541
MT
1494);
1495
1496
1497ALTER TABLE sources_commits OWNER TO pakfire;
1498
1499--
1500-- Name: sources_commits_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1501--
1502
1503CREATE SEQUENCE sources_commits_id_seq
1504 START WITH 1
1505 INCREMENT BY 1
1506 NO MINVALUE
1507 NO MAXVALUE
1508 CACHE 1;
1509
1510
1511ALTER TABLE sources_commits_id_seq OWNER TO pakfire;
1512
1513--
1514-- Name: sources_commits_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1515--
1516
1517ALTER SEQUENCE sources_commits_id_seq OWNED BY sources_commits.id;
1518
1519
1520--
1521-- Name: sources_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1522--
1523
1524CREATE SEQUENCE sources_id_seq
1525 START WITH 1
1526 INCREMENT BY 1
1527 NO MINVALUE
1528 NO MAXVALUE
1529 CACHE 1;
1530
1531
1532ALTER TABLE sources_id_seq OWNER TO pakfire;
1533
1534--
1535-- Name: sources_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1536--
1537
1538ALTER SEQUENCE sources_id_seq OWNED BY sources.id;
1539
1540
1541--
1542-- Name: uploads; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1543--
1544
1545CREATE TABLE uploads (
f835411e
MT
1546 id integer NOT NULL,
1547 uuid text NOT NULL,
1548 user_id integer,
1549 builder_id integer,
1550 filename text NOT NULL,
1551 hash text NOT NULL,
64316541 1552 size bigint NOT NULL,
f835411e 1553 progress bigint DEFAULT 0 NOT NULL,
024d6076 1554 finished boolean DEFAULT false NOT NULL,
f835411e
MT
1555 time_started timestamp without time zone DEFAULT now() NOT NULL,
1556 time_finished timestamp without time zone
64316541
MT
1557);
1558
1559
1560ALTER TABLE uploads OWNER TO pakfire;
1561
1562--
1563-- Name: uploads_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1564--
1565
1566CREATE SEQUENCE uploads_id_seq
1567 START WITH 1
1568 INCREMENT BY 1
1569 NO MINVALUE
1570 NO MAXVALUE
1571 CACHE 1;
1572
1573
1574ALTER TABLE uploads_id_seq OWNER TO pakfire;
1575
1576--
1577-- Name: uploads_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1578--
1579
1580ALTER SEQUENCE uploads_id_seq OWNED BY uploads.id;
1581
1582
1583--
1584-- Name: user_messages; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1585--
1586
1587CREATE TABLE user_messages (
f835411e
MT
1588 id integer NOT NULL,
1589 frm text NOT NULL,
1590 "to" text NOT NULL,
1591 subject text NOT NULL,
64316541 1592 text text NOT NULL,
f835411e 1593 time_added timestamp without time zone DEFAULT now() NOT NULL
64316541
MT
1594);
1595
1596
1597ALTER TABLE user_messages OWNER TO pakfire;
1598
1599--
1600-- Name: user_messages_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1601--
1602
1603CREATE SEQUENCE user_messages_id_seq
1604 START WITH 1
1605 INCREMENT BY 1
1606 NO MINVALUE
1607 NO MAXVALUE
1608 CACHE 1;
1609
1610
1611ALTER TABLE user_messages_id_seq OWNER TO pakfire;
1612
1613--
1614-- Name: user_messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1615--
1616
1617ALTER SEQUENCE user_messages_id_seq OWNED BY user_messages.id;
1618
1619
1620--
1621-- Name: users; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1622--
1623
1624CREATE TABLE users (
f835411e
MT
1625 id integer NOT NULL,
1626 name text NOT NULL,
1627 realname text,
26fe80df
JS
1628 passphrase text,
1629 state users_state DEFAULT 'user'::users_state NOT NULL,
f835411e
MT
1630 locale text,
1631 timezone text,
26fe80df
JS
1632 activated boolean DEFAULT false NOT NULL,
1633 deleted boolean DEFAULT false NOT NULL,
cc7c870f
MT
1634 registered timestamp without time zone DEFAULT now() NOT NULL,
1635 ldap_dn text
64316541
MT
1636);
1637
1638
1639ALTER TABLE users OWNER TO pakfire;
1640
1641--
1642-- Name: users_emails; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1643--
1644
1645CREATE TABLE users_emails (
f835411e
MT
1646 id integer NOT NULL,
1647 user_id integer NOT NULL,
1648 email text NOT NULL,
26fe80df
JS
1649 "primary" boolean DEFAULT false NOT NULL,
1650 activated boolean DEFAULT false NOT NULL,
1651 activation_code text
64316541
MT
1652);
1653
1654
1655ALTER TABLE users_emails OWNER TO pakfire;
1656
1657--
1658-- Name: users_emails_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1659--
1660
1661CREATE SEQUENCE users_emails_id_seq
1662 START WITH 1
1663 INCREMENT BY 1
1664 NO MINVALUE
1665 NO MAXVALUE
1666 CACHE 1;
1667
1668
1669ALTER TABLE users_emails_id_seq OWNER TO pakfire;
1670
1671--
1672-- Name: users_emails_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1673--
1674
1675ALTER SEQUENCE users_emails_id_seq OWNED BY users_emails.id;
1676
1677
1678--
1679-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1680--
1681
1682CREATE SEQUENCE users_id_seq
1683 START WITH 1
1684 INCREMENT BY 1
1685 NO MINVALUE
1686 NO MAXVALUE
1687 CACHE 1;
1688
1689
1690ALTER TABLE users_id_seq OWNER TO pakfire;
1691
1692--
1693-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1694--
1695
1696ALTER SEQUENCE users_id_seq OWNED BY users.id;
1697
1698
1699--
1700-- Name: users_permissions; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1701--
1702
1703CREATE TABLE users_permissions (
f835411e
MT
1704 id integer NOT NULL,
1705 user_id integer NOT NULL,
b9c2a52b
MT
1706 create_scratch_builds boolean DEFAULT false NOT NULL,
1707 maintain_builders boolean DEFAULT false NOT NULL,
1708 manage_critical_path boolean DEFAULT false NOT NULL,
1709 manage_mirrors boolean DEFAULT false NOT NULL,
1710 vote boolean DEFAULT false NOT NULL
64316541
MT
1711);
1712
1713
1714ALTER TABLE users_permissions OWNER TO pakfire;
1715
1716--
1717-- Name: users_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1718--
1719
1720CREATE SEQUENCE users_permissions_id_seq
1721 START WITH 1
1722 INCREMENT BY 1
1723 NO MINVALUE
1724 NO MAXVALUE
1725 CACHE 1;
1726
1727
1728ALTER TABLE users_permissions_id_seq OWNER TO pakfire;
1729
1730--
1731-- Name: users_permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1732--
1733
1734ALTER SEQUENCE users_permissions_id_seq OWNED BY users_permissions.id;
1735
1736
1737--
1738-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1739--
1740
1741ALTER TABLE ONLY arches ALTER COLUMN id SET DEFAULT nextval('arches_id_seq'::regclass);
1742
1743
1744--
1745-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1746--
1747
1748ALTER TABLE ONLY builders ALTER COLUMN id SET DEFAULT nextval('builders_id_seq'::regclass);
1749
1750
64316541
MT
1751--
1752-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1753--
1754
1755ALTER TABLE ONLY builders_history ALTER COLUMN id SET DEFAULT nextval('builders_history_id_seq'::regclass);
1756
1757
1758--
1759-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1760--
1761
1762ALTER TABLE ONLY builds ALTER COLUMN id SET DEFAULT nextval('builds_id_seq'::regclass);
1763
1764
1765--
1766-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1767--
1768
1769ALTER TABLE ONLY builds_bugs ALTER COLUMN id SET DEFAULT nextval('builds_bugs_id_seq'::regclass);
1770
1771
1772--
1773-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1774--
1775
1776ALTER TABLE ONLY builds_bugs_updates ALTER COLUMN id SET DEFAULT nextval('builds_bugs_updates_id_seq'::regclass);
1777
1778
1779--
1780-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1781--
1782
1783ALTER TABLE ONLY builds_comments ALTER COLUMN id SET DEFAULT nextval('builds_comments_id_seq'::regclass);
1784
1785
1786--
1787-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1788--
1789
1790ALTER TABLE ONLY builds_history ALTER COLUMN id SET DEFAULT nextval('builds_history_id_seq'::regclass);
1791
1792
1793--
1794-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1795--
1796
1797ALTER TABLE ONLY builds_watchers ALTER COLUMN id SET DEFAULT nextval('builds_watchers_id_seq'::regclass);
1798
1799
1800--
1801-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1802--
1803
1804ALTER TABLE ONLY distributions ALTER COLUMN id SET DEFAULT nextval('distributions_id_seq'::regclass);
1805
1806
1807--
1808-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1809--
1810
e459cbba 1811ALTER TABLE ONLY distributions_arches ALTER COLUMN id SET DEFAULT nextval('distro_arches_id_seq'::regclass);
64316541
MT
1812
1813
1814--
1815-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1816--
1817
1818ALTER TABLE ONLY images_types ALTER COLUMN id SET DEFAULT nextval('images_types_id_seq'::regclass);
1819
1820
1821--
1822-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1823--
1824
1825ALTER TABLE ONLY jobs ALTER COLUMN id SET DEFAULT nextval('jobs_id_seq'::regclass);
1826
1827
1828--
1829-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1830--
1831
1832ALTER TABLE ONLY jobs_packages ALTER COLUMN id SET DEFAULT nextval('jobs_packages_id_seq'::regclass);
1833
1834
1835--
1836-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1837--
1838
1839ALTER TABLE ONLY keys ALTER COLUMN id SET DEFAULT nextval('keys_id_seq'::regclass);
1840
1841
1842--
1843-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1844--
1845
1846ALTER TABLE ONLY keys_subkeys ALTER COLUMN id SET DEFAULT nextval('keys_subkeys_id_seq'::regclass);
1847
1848
1849--
1850-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1851--
1852
1853ALTER TABLE ONLY logfiles ALTER COLUMN id SET DEFAULT nextval('logfiles_id_seq'::regclass);
1854
1855
1856--
1857-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1858--
1859
1860ALTER TABLE ONLY mirrors ALTER COLUMN id SET DEFAULT nextval('mirrors_id_seq'::regclass);
1861
1862
c660ff59
MT
1863--
1864-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1865--
1866
1867ALTER TABLE ONLY mirrors_checks ALTER COLUMN id SET DEFAULT nextval('mirrors_checks_id_seq'::regclass);
1868
1869
64316541
MT
1870--
1871-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1872--
1873
1874ALTER TABLE ONLY mirrors_history ALTER COLUMN id SET DEFAULT nextval('mirrors_history_id_seq'::regclass);
1875
1876
1877--
1878-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1879--
1880
1881ALTER TABLE ONLY packages ALTER COLUMN id SET DEFAULT nextval('packages_id_seq'::regclass);
1882
1883
1884--
1885-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1886--
1887
1888ALTER TABLE ONLY packages_properties ALTER COLUMN id SET DEFAULT nextval('packages_properties_id_seq'::regclass);
1889
1890
1891--
1892-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1893--
1894
1895ALTER TABLE ONLY queue_delete ALTER COLUMN id SET DEFAULT nextval('queue_delete_id_seq'::regclass);
1896
1897
1898--
1899-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1900--
1901
1902ALTER TABLE ONLY repositories ALTER COLUMN id SET DEFAULT nextval('repositories_id_seq'::regclass);
1903
1904
1905--
1906-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1907--
1908
1909ALTER TABLE ONLY repositories_aux ALTER COLUMN id SET DEFAULT nextval('repositories_aux_id_seq'::regclass);
1910
1911
1912--
1913-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1914--
1915
1916ALTER TABLE ONLY repositories_builds ALTER COLUMN id SET DEFAULT nextval('repositories_builds_id_seq'::regclass);
1917
1918
d2738057
MT
1919--
1920-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1921--
1922
1923ALTER TABLE ONLY sessions ALTER COLUMN id SET DEFAULT nextval('sessions_id_seq'::regclass);
1924
1925
64316541
MT
1926--
1927-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1928--
1929
1930ALTER TABLE ONLY sources ALTER COLUMN id SET DEFAULT nextval('sources_id_seq'::regclass);
1931
1932
1933--
1934-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1935--
1936
1937ALTER TABLE ONLY sources_commits ALTER COLUMN id SET DEFAULT nextval('sources_commits_id_seq'::regclass);
1938
1939
1940--
1941-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1942--
1943
1944ALTER TABLE ONLY uploads ALTER COLUMN id SET DEFAULT nextval('uploads_id_seq'::regclass);
1945
1946
1947--
1948-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1949--
1950
1951ALTER TABLE ONLY user_messages ALTER COLUMN id SET DEFAULT nextval('user_messages_id_seq'::regclass);
1952
1953
1954--
1955-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1956--
1957
1958ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
1959
1960
1961--
1962-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1963--
1964
1965ALTER TABLE ONLY users_emails ALTER COLUMN id SET DEFAULT nextval('users_emails_id_seq'::regclass);
1966
1967
1968--
1969-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1970--
1971
1972ALTER TABLE ONLY users_permissions ALTER COLUMN id SET DEFAULT nextval('users_permissions_id_seq'::regclass);
1973
1974
e704b8e2
MT
1975--
1976-- Name: arches_compat_unique; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1977--
1978
1979ALTER TABLE ONLY arches_compat
1980 ADD CONSTRAINT arches_compat_unique UNIQUE (native_arch, build_arch);
1981
1982
3d743a8e
MT
1983--
1984-- Name: arches_name; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1985--
1986
1987ALTER TABLE ONLY arches
1988 ADD CONSTRAINT arches_name UNIQUE (name);
1989
1990
64316541
MT
1991--
1992-- Name: idx_2197943_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
1993--
1994
1995ALTER TABLE ONLY arches
1996 ADD CONSTRAINT idx_2197943_primary PRIMARY KEY (id);
1997
1998
1999--
2000-- Name: idx_2197954_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2001--
2002
2003ALTER TABLE ONLY builders
2004 ADD CONSTRAINT idx_2197954_primary PRIMARY KEY (id);
2005
2006
64316541
MT
2007--
2008-- Name: idx_2197982_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2009--
2010
2011ALTER TABLE ONLY builders_history
2012 ADD CONSTRAINT idx_2197982_primary PRIMARY KEY (id);
2013
2014
2015--
2016-- Name: idx_2197988_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2017--
2018
2019ALTER TABLE ONLY builds
2020 ADD CONSTRAINT idx_2197988_primary PRIMARY KEY (id);
2021
2022
2023--
2024-- Name: idx_2198002_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2025--
2026
2027ALTER TABLE ONLY builds_bugs
2028 ADD CONSTRAINT idx_2198002_primary PRIMARY KEY (id);
2029
2030
2031--
2032-- Name: idx_2198008_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2033--
2034
2035ALTER TABLE ONLY builds_bugs_updates
2036 ADD CONSTRAINT idx_2198008_primary PRIMARY KEY (id);
2037
2038
2039--
2040-- Name: idx_2198018_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2041--
2042
2043ALTER TABLE ONLY builds_comments
2044 ADD CONSTRAINT idx_2198018_primary PRIMARY KEY (id);
2045
2046
2047--
2048-- Name: idx_2198027_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2049--
2050
2051ALTER TABLE ONLY builds_history
2052 ADD CONSTRAINT idx_2198027_primary PRIMARY KEY (id);
2053
2054
2055--
2056-- Name: idx_2198033_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2057--
2058
2059ALTER TABLE ONLY builds_watchers
2060 ADD CONSTRAINT idx_2198033_primary PRIMARY KEY (id);
2061
2062
2063--
2064-- Name: idx_2198039_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2065--
2066
2067ALTER TABLE ONLY distributions
2068 ADD CONSTRAINT idx_2198039_primary PRIMARY KEY (id);
2069
2070
2071--
2072-- Name: idx_2198048_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2073--
2074
e459cbba 2075ALTER TABLE ONLY distributions_arches
64316541
MT
2076 ADD CONSTRAINT idx_2198048_primary PRIMARY KEY (id);
2077
2078
2079--
2080-- Name: idx_2198057_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2081--
2082
2083ALTER TABLE ONLY images_types
2084 ADD CONSTRAINT idx_2198057_primary PRIMARY KEY (id);
2085
2086
2087--
2088-- Name: idx_2198063_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2089--
2090
2091ALTER TABLE ONLY jobs
2092 ADD CONSTRAINT idx_2198063_primary PRIMARY KEY (id);
2093
2094
2095--
2096-- Name: idx_2198085_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2097--
2098
2099ALTER TABLE ONLY jobs_packages
2100 ADD CONSTRAINT idx_2198085_primary PRIMARY KEY (id);
2101
2102
2103--
2104-- Name: idx_2198094_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2105--
2106
2107ALTER TABLE ONLY keys
2108 ADD CONSTRAINT idx_2198094_primary PRIMARY KEY (id);
2109
2110
2111--
2112-- Name: idx_2198103_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2113--
2114
2115ALTER TABLE ONLY keys_subkeys
2116 ADD CONSTRAINT idx_2198103_primary PRIMARY KEY (id);
2117
2118
2119--
2120-- Name: idx_2198109_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2121--
2122
2123ALTER TABLE ONLY logfiles
2124 ADD CONSTRAINT idx_2198109_primary PRIMARY KEY (id);
2125
2126
2127--
2128-- Name: idx_2198115_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2129--
2130
2131ALTER TABLE ONLY mirrors
2132 ADD CONSTRAINT idx_2198115_primary PRIMARY KEY (id);
2133
2134
2135--
2136-- Name: idx_2198126_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2137--
2138
2139ALTER TABLE ONLY mirrors_history
2140 ADD CONSTRAINT idx_2198126_primary PRIMARY KEY (id);
2141
2142
2143--
2144-- Name: idx_2198132_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2145--
2146
2147ALTER TABLE ONLY packages
2148 ADD CONSTRAINT idx_2198132_primary PRIMARY KEY (id);
2149
2150
2151--
2152-- Name: idx_2198147_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2153--
2154
2155ALTER TABLE ONLY packages_properties
2156 ADD CONSTRAINT idx_2198147_primary PRIMARY KEY (id);
2157
2158
2159--
2160-- Name: idx_2198155_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2161--
2162
2163ALTER TABLE ONLY queue_delete
2164 ADD CONSTRAINT idx_2198155_primary PRIMARY KEY (id);
2165
2166
2167--
2168-- Name: idx_2198164_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2169--
2170
2171ALTER TABLE ONLY repositories
2172 ADD CONSTRAINT idx_2198164_primary PRIMARY KEY (id);
2173
2174
2175--
2176-- Name: idx_2198179_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2177--
2178
2179ALTER TABLE ONLY repositories_aux
2180 ADD CONSTRAINT idx_2198179_primary PRIMARY KEY (id);
2181
2182
2183--
2184-- Name: idx_2198189_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2185--
2186
2187ALTER TABLE ONLY repositories_builds
2188 ADD CONSTRAINT idx_2198189_primary PRIMARY KEY (id);
2189
2190
64316541
MT
2191--
2192-- Name: idx_2198213_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2193--
2194
2195ALTER TABLE ONLY sources
2196 ADD CONSTRAINT idx_2198213_primary PRIMARY KEY (id);
2197
2198
2199--
2200-- Name: idx_2198222_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2201--
2202
2203ALTER TABLE ONLY sources_commits
2204 ADD CONSTRAINT idx_2198222_primary PRIMARY KEY (id);
2205
2206
2207--
2208-- Name: idx_2198232_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2209--
2210
2211ALTER TABLE ONLY uploads
2212 ADD CONSTRAINT idx_2198232_primary PRIMARY KEY (id);
2213
2214
2215--
2216-- Name: idx_2198244_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2217--
2218
2219ALTER TABLE ONLY users
2220 ADD CONSTRAINT idx_2198244_primary PRIMARY KEY (id);
2221
2222
2223--
2224-- Name: idx_2198256_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2225--
2226
2227ALTER TABLE ONLY users_emails
2228 ADD CONSTRAINT idx_2198256_primary PRIMARY KEY (id);
2229
2230
2231--
2232-- Name: idx_2198263_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2233--
2234
2235ALTER TABLE ONLY users_permissions
2236 ADD CONSTRAINT idx_2198263_primary PRIMARY KEY (id);
2237
2238
2239--
2240-- Name: idx_2198274_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2241--
2242
2243ALTER TABLE ONLY user_messages
2244 ADD CONSTRAINT idx_2198274_primary PRIMARY KEY (id);
2245
2246
439d364e
MT
2247--
2248-- Name: jobs_packages_unique; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2249--
2250
2251ALTER TABLE ONLY jobs_packages
2252 ADD CONSTRAINT jobs_packages_unique UNIQUE (job_id, pkg_id);
2253
439d364e 2254
c660ff59
MT
2255--
2256-- Name: mirrors_checks_pkey; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2257--
2258
2259ALTER TABLE ONLY mirrors_checks
2260 ADD CONSTRAINT mirrors_checks_pkey PRIMARY KEY (id);
2261
2262
29fb7c98
MT
2263--
2264-- Name: repositories_builds_unique; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2265--
2266
2267ALTER TABLE ONLY repositories_builds
2268 ADD CONSTRAINT repositories_builds_unique UNIQUE (repo_id, build_id);
2269
2270
d2738057
MT
2271--
2272-- Name: sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2273--
2274
2275ALTER TABLE ONLY sessions
2276 ADD CONSTRAINT sessions_pkey PRIMARY KEY (id);
2277
2278
2279--
2280-- Name: sessions_session_id_key; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2281--
2282
2283ALTER TABLE ONLY sessions
2284 ADD CONSTRAINT sessions_session_id_key UNIQUE (session_id);
2285
2286
439d364e 2287--
e704b8e2 2288-- Name: arches_compat_native_arch; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
439d364e
MT
2289--
2290
e704b8e2 2291CREATE INDEX arches_compat_native_arch ON arches_compat USING btree (native_arch);
439d364e
MT
2292
2293
2294--
e704b8e2 2295-- Name: builders_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
439d364e
MT
2296--
2297
e704b8e2
MT
2298CREATE UNIQUE INDEX builders_name ON builders USING btree (name) WHERE (deleted IS FALSE);
2299
2300
2301--
2302-- Name: builds_watchers_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2303--
2304
2305CREATE INDEX builds_watchers_build_id ON builds_watchers USING btree (build_id);
439d364e
MT
2306
2307
e459cbba
MT
2308--
2309-- Name: distributions_arches_distro_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2310--
2311
2312CREATE INDEX distributions_arches_distro_id ON distributions_arches USING btree (distro_id);
2313
2314
2315--
2316-- Name: distributions_sname; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2317--
2318
2319CREATE UNIQUE INDEX distributions_sname ON distributions USING btree (sname) WHERE (deleted IS FALSE);
2320
2321
64316541 2322--
e704b8e2 2323-- Name: filelists_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
64316541
MT
2324--
2325
e704b8e2 2326CREATE INDEX filelists_name ON filelists USING btree (name);
64316541
MT
2327
2328
8066bbf3
MT
2329--
2330-- Name: filelists_pkg_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2331--
2332
2333CREATE INDEX filelists_pkg_id ON filelists USING btree (pkg_id);
2334
2335ALTER TABLE filelists CLUSTER ON filelists_pkg_id;
2336
2337
64316541
MT
2338--
2339-- Name: idx_2197982_builder_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2340--
2341
2342CREATE INDEX idx_2197982_builder_id ON builders_history USING btree (builder_id);
2343
2344
2345--
2346-- Name: idx_2197988_pkg_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2347--
2348
2349CREATE INDEX idx_2197988_pkg_id ON builds USING btree (pkg_id);
2350
2351
2352--
2353-- Name: idx_2197988_state; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2354--
2355
2356CREATE INDEX idx_2197988_state ON builds USING btree (state);
2357
2358
2359--
2360-- Name: idx_2197988_type; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2361--
2362
2363CREATE INDEX idx_2197988_type ON builds USING btree (type);
2364
2365
2366--
2367-- Name: idx_2197988_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2368--
2369
2370CREATE UNIQUE INDEX idx_2197988_uuid ON builds USING btree (uuid);
2371
2372
2373--
2374-- Name: idx_2198002_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2375--
2376
2377CREATE UNIQUE INDEX idx_2198002_build_id ON builds_bugs USING btree (build_id, bug_id);
2378
2379
2380--
2381-- Name: idx_2198018_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2382--
2383
2384CREATE INDEX idx_2198018_build_id ON builds_comments USING btree (build_id);
2385
2386
2387--
2388-- Name: idx_2198018_user_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2389--
2390
2391CREATE INDEX idx_2198018_user_id ON builds_comments USING btree (user_id);
2392
2393
64316541
MT
2394--
2395-- Name: idx_2198063_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2396--
2397
2398CREATE INDEX idx_2198063_build_id ON jobs USING btree (build_id);
2399
2400
2401--
2402-- Name: idx_2198063_state; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2403--
2404
2405CREATE INDEX idx_2198063_state ON jobs USING btree (state);
2406
2407
64316541
MT
2408--
2409-- Name: idx_2198063_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2410--
2411
2412CREATE UNIQUE INDEX idx_2198063_uuid ON jobs USING btree (uuid);
2413
2414
64316541
MT
2415--
2416-- Name: idx_2198080_job_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2417--
2418
2419CREATE INDEX idx_2198080_job_id ON jobs_history USING btree (job_id);
2420
2421
2422--
2423-- Name: idx_2198089_job_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2424--
2425
2426CREATE UNIQUE INDEX idx_2198089_job_id ON jobs_repos USING btree (job_id, repo_id);
2427
2428
2429--
2430-- Name: idx_2198094_fingerprint; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2431--
2432
2433CREATE UNIQUE INDEX idx_2198094_fingerprint ON keys USING btree (fingerprint);
2434
2435
64316541
MT
2436--
2437-- Name: idx_2198132_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2438--
2439
2440CREATE INDEX idx_2198132_name ON packages USING btree (name);
2441
2442
64316541
MT
2443--
2444-- Name: idx_2198132_type; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2445--
2446
2447CREATE INDEX idx_2198132_type ON packages USING btree (type);
2448
2449
2450--
2451-- Name: idx_2198132_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2452--
2453
2454CREATE INDEX idx_2198132_uuid ON packages USING btree (uuid);
2455
2456
64316541
MT
2457--
2458-- Name: idx_2198139_pkg_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2459--
2460
2461CREATE INDEX idx_2198139_pkg_id ON packages_deps USING btree (pkg_id);
2462
64316541
MT
2463
2464--
2465-- Name: idx_2198147_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2466--
2467
2468CREATE UNIQUE INDEX idx_2198147_name ON packages_properties USING btree (name);
2469
2470
2471--
2472-- Name: idx_2198189_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2473--
2474
2475CREATE UNIQUE INDEX idx_2198189_build_id ON repositories_builds USING btree (build_id);
2476
2477
2478--
2479-- Name: idx_2198193_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2480--
2481
2482CREATE INDEX idx_2198193_build_id ON repositories_history USING btree (build_id);
2483
2484
64316541
MT
2485--
2486-- Name: idx_2198199_k; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2487--
2488
2489CREATE UNIQUE INDEX idx_2198199_k ON settings USING btree (k);
2490
2491
2492--
2493-- Name: idx_2198213_identifier; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2494--
2495
2496CREATE UNIQUE INDEX idx_2198213_identifier ON sources USING btree (identifier);
2497
2498
2499--
2500-- Name: idx_2198222_revision; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2501--
2502
2503CREATE INDEX idx_2198222_revision ON sources_commits USING btree (revision);
2504
2505
2506--
2507-- Name: idx_2198232_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2508--
2509
2510CREATE UNIQUE INDEX idx_2198232_uuid ON uploads USING btree (uuid);
2511
2512
2513--
2514-- Name: idx_2198244_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2515--
2516
2517CREATE UNIQUE INDEX idx_2198244_name ON users USING btree (name);
2518
2519
2520--
2521-- Name: idx_2198256_email; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2522--
2523
2524CREATE UNIQUE INDEX idx_2198256_email ON users_emails USING btree (email);
2525
2526
2527--
2528-- Name: idx_2198256_user_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2529--
2530
2531CREATE INDEX idx_2198256_user_id ON users_emails USING btree (user_id);
2532
2533
3d743a8e
MT
2534--
2535-- Name: jobs_arch; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2536--
2537
2538CREATE INDEX jobs_arch ON jobs USING btree (arch);
2539
2540
6990cac2
MT
2541--
2542-- Name: jobs_buildroots_job_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2543--
2544
2545CREATE INDEX jobs_buildroots_job_id ON jobs_buildroots USING btree (job_id);
2546
2547ALTER TABLE jobs_buildroots CLUSTER ON jobs_buildroots_job_id;
2548
2549
439d364e
MT
2550--
2551-- Name: jobs_buildroots_pkg_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2552--
2553
2554CREATE INDEX jobs_buildroots_pkg_uuid ON jobs_buildroots USING btree (pkg_uuid);
2555
2556
e0e14322
MT
2557--
2558-- Name: jobs_queue_ready; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2559--
2560
2561CREATE INDEX jobs_queue_ready ON jobs USING btree (id) WHERE ((state = 'new'::text) AND (dependency_check_succeeded IS TRUE));
2562
2563
1b1f4a37
MT
2564--
2565-- Name: jobs_time_finished; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2566--
2567
2568CREATE INDEX jobs_time_finished ON jobs USING btree (time_finished DESC) WHERE (time_finished IS NOT NULL);
2569
2570
de667c37
MT
2571--
2572-- Name: jobs_time_started; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2573--
2574
2575CREATE INDEX jobs_time_started ON jobs USING btree (time_started) WHERE ((time_started IS NOT NULL) AND (time_finished IS NULL));
2576
2577
c660ff59
MT
2578--
2579-- Name: mirrors_checks_sort; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2580--
2581
2582CREATE INDEX mirrors_checks_sort ON mirrors_checks USING btree (mirror_id, "timestamp");
2583
2584ALTER TABLE mirrors_checks CLUSTER ON mirrors_checks_sort;
2585
2586
fe47bbac
MT
2587--
2588-- Name: repositories_builds_repo_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2589--
2590
2591CREATE INDEX repositories_builds_repo_id ON repositories_builds USING btree (repo_id);
2592
2593
64316541
MT
2594--
2595-- Name: on_update_current_timestamp; Type: TRIGGER; Schema: public; Owner: pakfire
2596--
2597
2598CREATE TRIGGER on_update_current_timestamp BEFORE UPDATE ON sources FOR EACH ROW EXECUTE PROCEDURE on_update_current_timestamp_sources();
2599
2600
e704b8e2
MT
2601--
2602-- Name: arches_compat_build_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2603--
2604
2605ALTER TABLE ONLY arches_compat
2606 ADD CONSTRAINT arches_compat_build_arch FOREIGN KEY (build_arch) REFERENCES arches(name);
2607
2608
439d364e
MT
2609--
2610-- Name: builders_history_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2611--
2612
2613ALTER TABLE ONLY builders_history
2614 ADD CONSTRAINT builders_history_builder_id FOREIGN KEY (builder_id) REFERENCES builders(id);
2615
2616
2617--
2618-- Name: builders_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2619--
2620
2621ALTER TABLE ONLY builders_history
2622 ADD CONSTRAINT builders_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2623
2624
2625--
2626-- Name: builds_bug_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2627--
2628
2629ALTER TABLE ONLY builds_bugs
2630 ADD CONSTRAINT builds_bug_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2631
2632
2633--
2634-- Name: builds_comments_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2635--
2636
2637ALTER TABLE ONLY builds_comments
2638 ADD CONSTRAINT builds_comments_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2639
2640
2641--
2642-- Name: builds_comments_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2643--
2644
2645ALTER TABLE ONLY builds_comments
2646 ADD CONSTRAINT builds_comments_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2647
2648
2649--
2650-- Name: builds_depends_on; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2651--
2652
2653ALTER TABLE ONLY builds
2654 ADD CONSTRAINT builds_depends_on FOREIGN KEY (depends_on) REFERENCES builds(id);
2655
2656
2657--
2658-- Name: builds_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2659--
2660
2661ALTER TABLE ONLY builds
2662 ADD CONSTRAINT builds_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
2663
2664
2665--
2666-- Name: builds_history_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2667--
2668
2669ALTER TABLE ONLY builds_history
2670 ADD CONSTRAINT builds_history_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2671
2672
2673--
2674-- Name: builds_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2675--
2676
2677ALTER TABLE ONLY builds_history
2678 ADD CONSTRAINT builds_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2679
2680
2681--
2682-- Name: builds_owner_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2683--
2684
2685ALTER TABLE ONLY builds
2686 ADD CONSTRAINT builds_owner_id FOREIGN KEY (owner_id) REFERENCES users(id);
2687
2688
2689--
2690-- Name: builds_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2691--
2692
2693ALTER TABLE ONLY builds
2694 ADD CONSTRAINT builds_pkg_id FOREIGN KEY (pkg_id) REFERENCES packages(id);
2695
2696
2697--
2698-- Name: builds_watchers_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2699--
2700
2701ALTER TABLE ONLY builds_watchers
2702 ADD CONSTRAINT builds_watchers_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2703
2704
2705--
2706-- Name: builds_watchers_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2707--
2708
2709ALTER TABLE ONLY builds_watchers
2710 ADD CONSTRAINT builds_watchers_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2711
2712
2713--
e459cbba 2714-- Name: distributions_arches_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
439d364e
MT
2715--
2716
e459cbba
MT
2717ALTER TABLE ONLY distributions_arches
2718 ADD CONSTRAINT distributions_arches_arch FOREIGN KEY (arch) REFERENCES arches(name);
439d364e
MT
2719
2720
2721--
2722-- Name: distro_arches_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2723--
2724
e459cbba 2725ALTER TABLE ONLY distributions_arches
439d364e
MT
2726 ADD CONSTRAINT distro_arches_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
2727
2728
2729--
2730-- Name: filelists_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2731--
2732
2733ALTER TABLE ONLY filelists
2734 ADD CONSTRAINT filelists_pkg_id FOREIGN KEY (pkg_id) REFERENCES packages(id);
2735
2736
2737--
3d743a8e 2738-- Name: jobs_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
439d364e
MT
2739--
2740
2741ALTER TABLE ONLY jobs
3d743a8e 2742 ADD CONSTRAINT jobs_arch FOREIGN KEY (arch) REFERENCES arches(name);
439d364e
MT
2743
2744
2745--
2746-- Name: jobs_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2747--
2748
2749ALTER TABLE ONLY jobs
2750 ADD CONSTRAINT jobs_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2751
2752
2753--
2754-- Name: jobs_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2755--
2756
2757ALTER TABLE ONLY jobs
2758 ADD CONSTRAINT jobs_builder_id FOREIGN KEY (builder_id) REFERENCES builders(id);
2759
2760
2761--
2762-- Name: jobs_buildroots_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2763--
2764
2765ALTER TABLE ONLY jobs_buildroots
2766 ADD CONSTRAINT jobs_buildroots_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
2767
2768
2769--
2770-- Name: jobs_history_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2771--
2772
2773ALTER TABLE ONLY jobs_history
2774 ADD CONSTRAINT jobs_history_builder_id FOREIGN KEY (builder_id) REFERENCES builders(id);
2775
2776
2777--
2778-- Name: jobs_history_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2779--
2780
2781ALTER TABLE ONLY jobs_history
2782 ADD CONSTRAINT jobs_history_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
2783
2784
2785--
2786-- Name: jobs_history_test_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2787--
2788
2789ALTER TABLE ONLY jobs_history
2790 ADD CONSTRAINT jobs_history_test_job_id FOREIGN KEY (test_job_id) REFERENCES jobs(id);
2791
2792
2793--
2794-- Name: jobs_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2795--
2796
2797ALTER TABLE ONLY jobs_history
2798 ADD CONSTRAINT jobs_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2799
2800
2801--
2802-- Name: jobs_packaged_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2803--
2804
2805ALTER TABLE ONLY jobs_packages
2806 ADD CONSTRAINT jobs_packaged_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
2807
2808
2809--
2810-- Name: jobs_packages_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2811--
2812
2813ALTER TABLE ONLY jobs_packages
2814 ADD CONSTRAINT jobs_packages_pkg_id FOREIGN KEY (pkg_id) REFERENCES packages(id);
2815
2816
2817--
2818-- Name: jobs_repos_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2819--
2820
2821ALTER TABLE ONLY jobs_repos
2822 ADD CONSTRAINT jobs_repos_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
2823
2824
2825--
2826-- Name: jobs_repos_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2827--
2828
2829ALTER TABLE ONLY jobs_repos
2830 ADD CONSTRAINT jobs_repos_repo_id FOREIGN KEY (repo_id) REFERENCES repositories(id);
2831
2832
2833--
2834-- Name: keys_subkeys_key_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2835--
2836
2837ALTER TABLE ONLY keys_subkeys
2838 ADD CONSTRAINT keys_subkeys_key_id FOREIGN KEY (key_id) REFERENCES keys(id);
2839
2840
2841--
2842-- Name: logfiles_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2843--
2844
2845ALTER TABLE ONLY logfiles
2846 ADD CONSTRAINT logfiles_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
2847
2848
c660ff59
MT
2849--
2850-- Name: mirrors_checks_mirror_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2851--
2852
2853ALTER TABLE ONLY mirrors_checks
2854 ADD CONSTRAINT mirrors_checks_mirror_id FOREIGN KEY (mirror_id) REFERENCES mirrors(id);
2855
2856
439d364e
MT
2857--
2858-- Name: mirrors_history_mirror_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2859--
2860
2861ALTER TABLE ONLY mirrors_history
2862 ADD CONSTRAINT mirrors_history_mirror_id FOREIGN KEY (mirror_id) REFERENCES mirrors(id);
2863
2864
2865--
2866-- Name: mirrors_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2867--
2868
2869ALTER TABLE ONLY mirrors_history
2870 ADD CONSTRAINT mirrors_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2871
2872
f835411e
MT
2873--
2874-- Name: packages_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2875--
2876
2877ALTER TABLE ONLY packages
22b715d7 2878 ADD CONSTRAINT packages_arch FOREIGN KEY (arch) REFERENCES arches(name);
f835411e
MT
2879
2880
2881--
2882-- Name: packages_commit_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2883--
2884
2885ALTER TABLE ONLY packages
2886 ADD CONSTRAINT packages_commit_id FOREIGN KEY (commit_id) REFERENCES sources_commits(id);
2887
2888
439d364e
MT
2889--
2890-- Name: packages_deps_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2891--
2892
2893ALTER TABLE ONLY packages_deps
2894 ADD CONSTRAINT packages_deps_pkg_id FOREIGN KEY (pkg_id) REFERENCES packages(id);
2895
2896
2897--
2898-- Name: repositories_aux_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2899--
2900
2901ALTER TABLE ONLY repositories_aux
2902 ADD CONSTRAINT repositories_aux_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
2903
2904
2905--
2906-- Name: repositories_builds_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2907--
2908
2909ALTER TABLE ONLY repositories_builds
2910 ADD CONSTRAINT repositories_builds_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2911
2912
2913--
2914-- Name: repositories_builds_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2915--
2916
2917ALTER TABLE ONLY repositories_builds
2918 ADD CONSTRAINT repositories_builds_repo_id FOREIGN KEY (repo_id) REFERENCES repositories(id);
2919
2920
2921--
2922-- Name: repositories_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2923--
2924
2925ALTER TABLE ONLY repositories
2926 ADD CONSTRAINT repositories_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
2927
2928
2929--
2930-- Name: repositories_history_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2931--
2932
2933ALTER TABLE ONLY repositories_history
2934 ADD CONSTRAINT repositories_history_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2935
2936
2937--
2938-- Name: repositories_history_from_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2939--
2940
2941ALTER TABLE ONLY repositories_history
2942 ADD CONSTRAINT repositories_history_from_repo_id FOREIGN KEY (from_repo_id) REFERENCES repositories(id);
2943
2944
2945--
2946-- Name: repositories_history_to_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2947--
2948
2949ALTER TABLE ONLY repositories_history
2950 ADD CONSTRAINT repositories_history_to_repo_id FOREIGN KEY (to_repo_id) REFERENCES repositories(id);
2951
2952
2953--
2954-- Name: repositories_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2955--
2956
2957ALTER TABLE ONLY repositories_history
2958 ADD CONSTRAINT repositories_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2959
2960
2961--
2962-- Name: repositories_key_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2963--
2964
2965ALTER TABLE ONLY repositories
2966 ADD CONSTRAINT repositories_key_id FOREIGN KEY (key_id) REFERENCES keys(id);
2967
2968
2969--
2970-- Name: repositories_parent_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2971--
2972
2973ALTER TABLE ONLY repositories
2974 ADD CONSTRAINT repositories_parent_id FOREIGN KEY (parent_id) REFERENCES repositories(id);
2975
2976
a7a18be1
MT
2977--
2978-- Name: repositories_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2979--
2980
2981ALTER TABLE ONLY repositories
2982 ADD CONSTRAINT repositories_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2983
2984
439d364e
MT
2985--
2986-- Name: sessions_impersonated_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2987--
2988
2989ALTER TABLE ONLY sessions
2990 ADD CONSTRAINT sessions_impersonated_user_id FOREIGN KEY (impersonated_user_id) REFERENCES users(id);
2991
2992
2993--
2994-- Name: sessions_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2995--
2996
2997ALTER TABLE ONLY sessions
2998 ADD CONSTRAINT sessions_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2999
3000
3001--
3002-- Name: sources_commits_source_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3003--
3004
3005ALTER TABLE ONLY sources_commits
3006 ADD CONSTRAINT sources_commits_source_id FOREIGN KEY (source_id) REFERENCES sources(id);
3007
3008
3009--
3010-- Name: sources_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3011--
3012
3013ALTER TABLE ONLY sources
3014 ADD CONSTRAINT sources_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
3015
3016
3017--
3018-- Name: uploads_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3019--
3020
3021ALTER TABLE ONLY uploads
3022 ADD CONSTRAINT uploads_builder_id FOREIGN KEY (builder_id) REFERENCES builders(id);
3023
3024
3025--
3026-- Name: uploads_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3027--
3028
3029ALTER TABLE ONLY uploads
3030 ADD CONSTRAINT uploads_user_id FOREIGN KEY (user_id) REFERENCES users(id);
3031
3032
3033--
3034-- Name: users_emails_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3035--
3036
3037ALTER TABLE ONLY users_emails
61ec461c 3038 ADD CONSTRAINT users_emails_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
439d364e
MT
3039
3040
3041--
3042-- Name: users_permissions_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3043--
3044
3045ALTER TABLE ONLY users_permissions
61ec461c 3046 ADD CONSTRAINT users_permissions_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
439d364e
MT
3047
3048
64316541
MT
3049--
3050-- PostgreSQL database dump complete
3051--
9050c160 3052