]> git.ipfire.org Git - pbs.git/blame - src/database.sql
db: Add fields to store password recovery tokens
[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 1632 registered timestamp without time zone DEFAULT now() NOT NULL,
8b4010c2
MT
1633 ldap_dn text,
1634 password_recovery_code text,
1635 password_recovery_code_expires_at timestamp without time zone
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
68dd077d
MT
1856--
1857-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1858--
1859
1860ALTER TABLE ONLY messages ALTER COLUMN id SET DEFAULT nextval('messages_id_seq'::regclass);
1861
1862
64316541
MT
1863--
1864-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1865--
1866
1867ALTER TABLE ONLY mirrors ALTER COLUMN id SET DEFAULT nextval('mirrors_id_seq'::regclass);
1868
1869
c660ff59
MT
1870--
1871-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1872--
1873
1874ALTER TABLE ONLY mirrors_checks ALTER COLUMN id SET DEFAULT nextval('mirrors_checks_id_seq'::regclass);
1875
1876
64316541
MT
1877--
1878-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1879--
1880
1881ALTER TABLE ONLY mirrors_history ALTER COLUMN id SET DEFAULT nextval('mirrors_history_id_seq'::regclass);
1882
1883
1884--
1885-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1886--
1887
1888ALTER TABLE ONLY packages ALTER COLUMN id SET DEFAULT nextval('packages_id_seq'::regclass);
1889
1890
1891--
1892-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1893--
1894
1895ALTER TABLE ONLY packages_properties ALTER COLUMN id SET DEFAULT nextval('packages_properties_id_seq'::regclass);
1896
1897
1898--
1899-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1900--
1901
1902ALTER TABLE ONLY queue_delete ALTER COLUMN id SET DEFAULT nextval('queue_delete_id_seq'::regclass);
1903
1904
1905--
1906-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1907--
1908
1909ALTER TABLE ONLY repositories ALTER COLUMN id SET DEFAULT nextval('repositories_id_seq'::regclass);
1910
1911
1912--
1913-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1914--
1915
1916ALTER TABLE ONLY repositories_aux ALTER COLUMN id SET DEFAULT nextval('repositories_aux_id_seq'::regclass);
1917
1918
1919--
1920-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1921--
1922
1923ALTER TABLE ONLY repositories_builds ALTER COLUMN id SET DEFAULT nextval('repositories_builds_id_seq'::regclass);
1924
1925
d2738057
MT
1926--
1927-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1928--
1929
1930ALTER TABLE ONLY sessions ALTER COLUMN id SET DEFAULT nextval('sessions_id_seq'::regclass);
1931
1932
64316541
MT
1933--
1934-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1935--
1936
1937ALTER TABLE ONLY sources ALTER COLUMN id SET DEFAULT nextval('sources_id_seq'::regclass);
1938
1939
1940--
1941-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1942--
1943
1944ALTER TABLE ONLY sources_commits ALTER COLUMN id SET DEFAULT nextval('sources_commits_id_seq'::regclass);
1945
1946
1947--
1948-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
1949--
1950
1951ALTER TABLE ONLY uploads ALTER COLUMN id SET DEFAULT nextval('uploads_id_seq'::regclass);
1952
1953
64316541
MT
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
68dd077d 2243ALTER TABLE ONLY messages
64316541
MT
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
8b4010c2
MT
2287--
2288-- Name: users_password_recovery_code; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2289--
2290
2291ALTER TABLE ONLY users
2292 ADD CONSTRAINT users_password_recovery_code UNIQUE (password_recovery_code);
2293
2294
439d364e 2295--
e704b8e2 2296-- Name: arches_compat_native_arch; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
439d364e
MT
2297--
2298
e704b8e2 2299CREATE INDEX arches_compat_native_arch ON arches_compat USING btree (native_arch);
439d364e
MT
2300
2301
2302--
e704b8e2 2303-- Name: builders_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
439d364e
MT
2304--
2305
e704b8e2
MT
2306CREATE UNIQUE INDEX builders_name ON builders USING btree (name) WHERE (deleted IS FALSE);
2307
2308
2309--
2310-- Name: builds_watchers_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2311--
2312
2313CREATE INDEX builds_watchers_build_id ON builds_watchers USING btree (build_id);
439d364e
MT
2314
2315
e459cbba
MT
2316--
2317-- Name: distributions_arches_distro_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2318--
2319
2320CREATE INDEX distributions_arches_distro_id ON distributions_arches USING btree (distro_id);
2321
2322
2323--
2324-- Name: distributions_sname; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2325--
2326
2327CREATE UNIQUE INDEX distributions_sname ON distributions USING btree (sname) WHERE (deleted IS FALSE);
2328
2329
64316541 2330--
e704b8e2 2331-- Name: filelists_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
64316541
MT
2332--
2333
e704b8e2 2334CREATE INDEX filelists_name ON filelists USING btree (name);
64316541
MT
2335
2336
8066bbf3
MT
2337--
2338-- Name: filelists_pkg_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2339--
2340
2341CREATE INDEX filelists_pkg_id ON filelists USING btree (pkg_id);
2342
2343ALTER TABLE filelists CLUSTER ON filelists_pkg_id;
2344
2345
64316541
MT
2346--
2347-- Name: idx_2197982_builder_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2348--
2349
2350CREATE INDEX idx_2197982_builder_id ON builders_history USING btree (builder_id);
2351
2352
2353--
2354-- Name: idx_2197988_pkg_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2355--
2356
2357CREATE INDEX idx_2197988_pkg_id ON builds USING btree (pkg_id);
2358
2359
2360--
2361-- Name: idx_2197988_state; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2362--
2363
2364CREATE INDEX idx_2197988_state ON builds USING btree (state);
2365
2366
2367--
2368-- Name: idx_2197988_type; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2369--
2370
2371CREATE INDEX idx_2197988_type ON builds USING btree (type);
2372
2373
2374--
2375-- Name: idx_2197988_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2376--
2377
2378CREATE UNIQUE INDEX idx_2197988_uuid ON builds USING btree (uuid);
2379
2380
2381--
2382-- Name: idx_2198002_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2383--
2384
2385CREATE UNIQUE INDEX idx_2198002_build_id ON builds_bugs USING btree (build_id, bug_id);
2386
2387
2388--
2389-- Name: idx_2198018_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2390--
2391
2392CREATE INDEX idx_2198018_build_id ON builds_comments USING btree (build_id);
2393
2394
2395--
2396-- Name: idx_2198018_user_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2397--
2398
2399CREATE INDEX idx_2198018_user_id ON builds_comments USING btree (user_id);
2400
2401
64316541
MT
2402--
2403-- Name: idx_2198063_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2404--
2405
2406CREATE INDEX idx_2198063_build_id ON jobs USING btree (build_id);
2407
2408
2409--
2410-- Name: idx_2198063_state; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2411--
2412
2413CREATE INDEX idx_2198063_state ON jobs USING btree (state);
2414
2415
64316541
MT
2416--
2417-- Name: idx_2198063_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2418--
2419
2420CREATE UNIQUE INDEX idx_2198063_uuid ON jobs USING btree (uuid);
2421
2422
64316541
MT
2423--
2424-- Name: idx_2198080_job_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2425--
2426
2427CREATE INDEX idx_2198080_job_id ON jobs_history USING btree (job_id);
2428
2429
2430--
2431-- Name: idx_2198089_job_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2432--
2433
2434CREATE UNIQUE INDEX idx_2198089_job_id ON jobs_repos USING btree (job_id, repo_id);
2435
2436
2437--
2438-- Name: idx_2198094_fingerprint; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2439--
2440
2441CREATE UNIQUE INDEX idx_2198094_fingerprint ON keys USING btree (fingerprint);
2442
2443
64316541
MT
2444--
2445-- Name: idx_2198132_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2446--
2447
2448CREATE INDEX idx_2198132_name ON packages USING btree (name);
2449
2450
64316541
MT
2451--
2452-- Name: idx_2198132_type; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2453--
2454
2455CREATE INDEX idx_2198132_type ON packages USING btree (type);
2456
2457
2458--
2459-- Name: idx_2198132_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2460--
2461
2462CREATE INDEX idx_2198132_uuid ON packages USING btree (uuid);
2463
2464
64316541
MT
2465--
2466-- Name: idx_2198139_pkg_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2467--
2468
2469CREATE INDEX idx_2198139_pkg_id ON packages_deps USING btree (pkg_id);
2470
64316541
MT
2471
2472--
2473-- Name: idx_2198147_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2474--
2475
2476CREATE UNIQUE INDEX idx_2198147_name ON packages_properties USING btree (name);
2477
2478
2479--
2480-- Name: idx_2198189_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2481--
2482
2483CREATE UNIQUE INDEX idx_2198189_build_id ON repositories_builds USING btree (build_id);
2484
2485
2486--
2487-- Name: idx_2198193_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2488--
2489
2490CREATE INDEX idx_2198193_build_id ON repositories_history USING btree (build_id);
2491
2492
64316541
MT
2493--
2494-- Name: idx_2198199_k; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2495--
2496
2497CREATE UNIQUE INDEX idx_2198199_k ON settings USING btree (k);
2498
2499
2500--
2501-- Name: idx_2198213_identifier; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2502--
2503
2504CREATE UNIQUE INDEX idx_2198213_identifier ON sources USING btree (identifier);
2505
2506
2507--
2508-- Name: idx_2198222_revision; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2509--
2510
2511CREATE INDEX idx_2198222_revision ON sources_commits USING btree (revision);
2512
2513
2514--
2515-- Name: idx_2198232_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2516--
2517
2518CREATE UNIQUE INDEX idx_2198232_uuid ON uploads USING btree (uuid);
2519
2520
2521--
2522-- Name: idx_2198244_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2523--
2524
2525CREATE UNIQUE INDEX idx_2198244_name ON users USING btree (name);
2526
2527
2528--
2529-- Name: idx_2198256_email; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2530--
2531
2532CREATE UNIQUE INDEX idx_2198256_email ON users_emails USING btree (email);
2533
2534
2535--
2536-- Name: idx_2198256_user_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2537--
2538
2539CREATE INDEX idx_2198256_user_id ON users_emails USING btree (user_id);
2540
2541
3d743a8e
MT
2542--
2543-- Name: jobs_arch; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2544--
2545
2546CREATE INDEX jobs_arch ON jobs USING btree (arch);
2547
2548
0a0d8db7
MT
2549--
2550-- Name: jobs_builders_active_jobs; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2551--
2552
2553CREATE INDEX jobs_builders_active_jobs ON jobs USING btree (builder_id) WHERE (state = ANY (ARRAY['dispatching'::text, 'running'::text]));
2554
2555
6990cac2
MT
2556--
2557-- Name: jobs_buildroots_job_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2558--
2559
2560CREATE INDEX jobs_buildroots_job_id ON jobs_buildroots USING btree (job_id);
2561
2562ALTER TABLE jobs_buildroots CLUSTER ON jobs_buildroots_job_id;
2563
2564
439d364e
MT
2565--
2566-- Name: jobs_buildroots_pkg_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2567--
2568
2569CREATE INDEX jobs_buildroots_pkg_uuid ON jobs_buildroots USING btree (pkg_uuid);
2570
2571
e0e14322
MT
2572--
2573-- Name: jobs_queue_ready; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2574--
2575
2576CREATE INDEX jobs_queue_ready ON jobs USING btree (id) WHERE ((state = 'new'::text) AND (dependency_check_succeeded IS TRUE));
2577
2578
1b1f4a37
MT
2579--
2580-- Name: jobs_time_finished; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2581--
2582
2583CREATE INDEX jobs_time_finished ON jobs USING btree (time_finished DESC) WHERE (time_finished IS NOT NULL);
2584
2585
de667c37
MT
2586--
2587-- Name: jobs_time_started; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2588--
2589
2590CREATE INDEX jobs_time_started ON jobs USING btree (time_started) WHERE ((time_started IS NOT NULL) AND (time_finished IS NULL));
2591
2592
68dd077d
MT
2593--
2594-- Name: messages_order; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2595--
2596
2597CREATE INDEX messages_order ON messages USING btree (queued_at) WHERE (sent_at IS NULL);
2598
2599
c660ff59
MT
2600--
2601-- Name: mirrors_checks_sort; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2602--
2603
2604CREATE INDEX mirrors_checks_sort ON mirrors_checks USING btree (mirror_id, "timestamp");
2605
2606ALTER TABLE mirrors_checks CLUSTER ON mirrors_checks_sort;
2607
2608
fe47bbac
MT
2609--
2610-- Name: repositories_builds_repo_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2611--
2612
2613CREATE INDEX repositories_builds_repo_id ON repositories_builds USING btree (repo_id);
2614
2615
64316541
MT
2616--
2617-- Name: on_update_current_timestamp; Type: TRIGGER; Schema: public; Owner: pakfire
2618--
2619
2620CREATE TRIGGER on_update_current_timestamp BEFORE UPDATE ON sources FOR EACH ROW EXECUTE PROCEDURE on_update_current_timestamp_sources();
2621
2622
e704b8e2
MT
2623--
2624-- Name: arches_compat_build_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2625--
2626
2627ALTER TABLE ONLY arches_compat
2628 ADD CONSTRAINT arches_compat_build_arch FOREIGN KEY (build_arch) REFERENCES arches(name);
2629
2630
439d364e
MT
2631--
2632-- Name: builders_history_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2633--
2634
2635ALTER TABLE ONLY builders_history
2636 ADD CONSTRAINT builders_history_builder_id FOREIGN KEY (builder_id) REFERENCES builders(id);
2637
2638
2639--
2640-- Name: builders_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2641--
2642
2643ALTER TABLE ONLY builders_history
2644 ADD CONSTRAINT builders_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2645
2646
2647--
2648-- Name: builds_bug_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2649--
2650
2651ALTER TABLE ONLY builds_bugs
2652 ADD CONSTRAINT builds_bug_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2653
2654
2655--
2656-- Name: builds_comments_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2657--
2658
2659ALTER TABLE ONLY builds_comments
2660 ADD CONSTRAINT builds_comments_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2661
2662
2663--
2664-- Name: builds_comments_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2665--
2666
2667ALTER TABLE ONLY builds_comments
2668 ADD CONSTRAINT builds_comments_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2669
2670
2671--
2672-- Name: builds_depends_on; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2673--
2674
2675ALTER TABLE ONLY builds
2676 ADD CONSTRAINT builds_depends_on FOREIGN KEY (depends_on) REFERENCES builds(id);
2677
2678
2679--
2680-- Name: builds_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2681--
2682
2683ALTER TABLE ONLY builds
2684 ADD CONSTRAINT builds_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
2685
2686
2687--
2688-- Name: builds_history_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2689--
2690
2691ALTER TABLE ONLY builds_history
2692 ADD CONSTRAINT builds_history_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2693
2694
2695--
2696-- Name: builds_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2697--
2698
2699ALTER TABLE ONLY builds_history
2700 ADD CONSTRAINT builds_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2701
2702
2703--
2704-- Name: builds_owner_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2705--
2706
2707ALTER TABLE ONLY builds
2708 ADD CONSTRAINT builds_owner_id FOREIGN KEY (owner_id) REFERENCES users(id);
2709
2710
2711--
2712-- Name: builds_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2713--
2714
2715ALTER TABLE ONLY builds
2716 ADD CONSTRAINT builds_pkg_id FOREIGN KEY (pkg_id) REFERENCES packages(id);
2717
2718
2719--
2720-- Name: builds_watchers_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2721--
2722
2723ALTER TABLE ONLY builds_watchers
2724 ADD CONSTRAINT builds_watchers_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2725
2726
2727--
2728-- Name: builds_watchers_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2729--
2730
2731ALTER TABLE ONLY builds_watchers
2732 ADD CONSTRAINT builds_watchers_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2733
2734
2735--
e459cbba 2736-- Name: distributions_arches_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
439d364e
MT
2737--
2738
e459cbba
MT
2739ALTER TABLE ONLY distributions_arches
2740 ADD CONSTRAINT distributions_arches_arch FOREIGN KEY (arch) REFERENCES arches(name);
439d364e
MT
2741
2742
2743--
2744-- Name: distro_arches_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2745--
2746
e459cbba 2747ALTER TABLE ONLY distributions_arches
439d364e
MT
2748 ADD CONSTRAINT distro_arches_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
2749
2750
2751--
2752-- Name: filelists_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2753--
2754
2755ALTER TABLE ONLY filelists
2756 ADD CONSTRAINT filelists_pkg_id FOREIGN KEY (pkg_id) REFERENCES packages(id);
2757
2758
2759--
3d743a8e 2760-- Name: jobs_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
439d364e
MT
2761--
2762
2763ALTER TABLE ONLY jobs
3d743a8e 2764 ADD CONSTRAINT jobs_arch FOREIGN KEY (arch) REFERENCES arches(name);
439d364e
MT
2765
2766
2767--
2768-- Name: jobs_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2769--
2770
2771ALTER TABLE ONLY jobs
2772 ADD CONSTRAINT jobs_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2773
2774
2775--
2776-- Name: jobs_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2777--
2778
2779ALTER TABLE ONLY jobs
2780 ADD CONSTRAINT jobs_builder_id FOREIGN KEY (builder_id) REFERENCES builders(id);
2781
2782
2783--
2784-- Name: jobs_buildroots_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2785--
2786
2787ALTER TABLE ONLY jobs_buildroots
2788 ADD CONSTRAINT jobs_buildroots_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
2789
2790
2791--
2792-- Name: jobs_history_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2793--
2794
2795ALTER TABLE ONLY jobs_history
2796 ADD CONSTRAINT jobs_history_builder_id FOREIGN KEY (builder_id) REFERENCES builders(id);
2797
2798
2799--
2800-- Name: jobs_history_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2801--
2802
2803ALTER TABLE ONLY jobs_history
2804 ADD CONSTRAINT jobs_history_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
2805
2806
2807--
2808-- Name: jobs_history_test_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2809--
2810
2811ALTER TABLE ONLY jobs_history
2812 ADD CONSTRAINT jobs_history_test_job_id FOREIGN KEY (test_job_id) REFERENCES jobs(id);
2813
2814
2815--
2816-- Name: jobs_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2817--
2818
2819ALTER TABLE ONLY jobs_history
2820 ADD CONSTRAINT jobs_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2821
2822
2823--
2824-- Name: jobs_packaged_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2825--
2826
2827ALTER TABLE ONLY jobs_packages
2828 ADD CONSTRAINT jobs_packaged_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
2829
2830
2831--
2832-- Name: jobs_packages_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2833--
2834
2835ALTER TABLE ONLY jobs_packages
2836 ADD CONSTRAINT jobs_packages_pkg_id FOREIGN KEY (pkg_id) REFERENCES packages(id);
2837
2838
2839--
2840-- Name: jobs_repos_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2841--
2842
2843ALTER TABLE ONLY jobs_repos
2844 ADD CONSTRAINT jobs_repos_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
2845
2846
2847--
2848-- Name: jobs_repos_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2849--
2850
2851ALTER TABLE ONLY jobs_repos
2852 ADD CONSTRAINT jobs_repos_repo_id FOREIGN KEY (repo_id) REFERENCES repositories(id);
2853
2854
84f143b0
MT
2855--
2856-- Name: jobs_superseeded_by; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2857--
2858
2859ALTER TABLE ONLY jobs
2860 ADD CONSTRAINT jobs_superseeded_by FOREIGN KEY (superseeded_by) REFERENCES jobs(id);
2861
2862
439d364e
MT
2863--
2864-- Name: keys_subkeys_key_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2865--
2866
2867ALTER TABLE ONLY keys_subkeys
2868 ADD CONSTRAINT keys_subkeys_key_id FOREIGN KEY (key_id) REFERENCES keys(id);
2869
2870
2871--
2872-- Name: logfiles_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2873--
2874
2875ALTER TABLE ONLY logfiles
2876 ADD CONSTRAINT logfiles_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
2877
2878
c660ff59
MT
2879--
2880-- Name: mirrors_checks_mirror_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2881--
2882
2883ALTER TABLE ONLY mirrors_checks
2884 ADD CONSTRAINT mirrors_checks_mirror_id FOREIGN KEY (mirror_id) REFERENCES mirrors(id);
2885
2886
439d364e
MT
2887--
2888-- Name: mirrors_history_mirror_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2889--
2890
2891ALTER TABLE ONLY mirrors_history
2892 ADD CONSTRAINT mirrors_history_mirror_id FOREIGN KEY (mirror_id) REFERENCES mirrors(id);
2893
2894
2895--
2896-- Name: mirrors_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2897--
2898
2899ALTER TABLE ONLY mirrors_history
2900 ADD CONSTRAINT mirrors_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2901
2902
f835411e
MT
2903--
2904-- Name: packages_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2905--
2906
2907ALTER TABLE ONLY packages
22b715d7 2908 ADD CONSTRAINT packages_arch FOREIGN KEY (arch) REFERENCES arches(name);
f835411e
MT
2909
2910
2911--
2912-- Name: packages_commit_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2913--
2914
2915ALTER TABLE ONLY packages
2916 ADD CONSTRAINT packages_commit_id FOREIGN KEY (commit_id) REFERENCES sources_commits(id);
2917
2918
439d364e
MT
2919--
2920-- Name: packages_deps_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2921--
2922
2923ALTER TABLE ONLY packages_deps
2924 ADD CONSTRAINT packages_deps_pkg_id FOREIGN KEY (pkg_id) REFERENCES packages(id);
2925
2926
2927--
2928-- Name: repositories_aux_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2929--
2930
2931ALTER TABLE ONLY repositories_aux
2932 ADD CONSTRAINT repositories_aux_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
2933
2934
2935--
2936-- Name: repositories_builds_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2937--
2938
2939ALTER TABLE ONLY repositories_builds
2940 ADD CONSTRAINT repositories_builds_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2941
2942
2943--
2944-- Name: repositories_builds_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2945--
2946
2947ALTER TABLE ONLY repositories_builds
2948 ADD CONSTRAINT repositories_builds_repo_id FOREIGN KEY (repo_id) REFERENCES repositories(id);
2949
2950
2951--
2952-- Name: repositories_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2953--
2954
2955ALTER TABLE ONLY repositories
2956 ADD CONSTRAINT repositories_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
2957
2958
2959--
2960-- Name: repositories_history_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2961--
2962
2963ALTER TABLE ONLY repositories_history
2964 ADD CONSTRAINT repositories_history_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2965
2966
2967--
2968-- Name: repositories_history_from_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2969--
2970
2971ALTER TABLE ONLY repositories_history
2972 ADD CONSTRAINT repositories_history_from_repo_id FOREIGN KEY (from_repo_id) REFERENCES repositories(id);
2973
2974
2975--
2976-- Name: repositories_history_to_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2977--
2978
2979ALTER TABLE ONLY repositories_history
2980 ADD CONSTRAINT repositories_history_to_repo_id FOREIGN KEY (to_repo_id) REFERENCES repositories(id);
2981
2982
2983--
2984-- Name: repositories_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2985--
2986
2987ALTER TABLE ONLY repositories_history
2988 ADD CONSTRAINT repositories_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2989
2990
2991--
2992-- Name: repositories_key_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2993--
2994
2995ALTER TABLE ONLY repositories
2996 ADD CONSTRAINT repositories_key_id FOREIGN KEY (key_id) REFERENCES keys(id);
2997
2998
2999--
3000-- Name: repositories_parent_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3001--
3002
3003ALTER TABLE ONLY repositories
3004 ADD CONSTRAINT repositories_parent_id FOREIGN KEY (parent_id) REFERENCES repositories(id);
3005
3006
a7a18be1
MT
3007--
3008-- Name: repositories_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3009--
3010
3011ALTER TABLE ONLY repositories
3012 ADD CONSTRAINT repositories_user_id FOREIGN KEY (user_id) REFERENCES users(id);
3013
3014
439d364e
MT
3015--
3016-- Name: sessions_impersonated_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3017--
3018
3019ALTER TABLE ONLY sessions
3020 ADD CONSTRAINT sessions_impersonated_user_id FOREIGN KEY (impersonated_user_id) REFERENCES users(id);
3021
3022
3023--
3024-- Name: sessions_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3025--
3026
3027ALTER TABLE ONLY sessions
3028 ADD CONSTRAINT sessions_user_id FOREIGN KEY (user_id) REFERENCES users(id);
3029
3030
3031--
3032-- Name: sources_commits_source_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3033--
3034
3035ALTER TABLE ONLY sources_commits
3036 ADD CONSTRAINT sources_commits_source_id FOREIGN KEY (source_id) REFERENCES sources(id);
3037
3038
3039--
3040-- Name: sources_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3041--
3042
3043ALTER TABLE ONLY sources
3044 ADD CONSTRAINT sources_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
3045
3046
3047--
3048-- Name: uploads_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3049--
3050
3051ALTER TABLE ONLY uploads
3052 ADD CONSTRAINT uploads_builder_id FOREIGN KEY (builder_id) REFERENCES builders(id);
3053
3054
3055--
3056-- Name: uploads_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3057--
3058
3059ALTER TABLE ONLY uploads
3060 ADD CONSTRAINT uploads_user_id FOREIGN KEY (user_id) REFERENCES users(id);
3061
3062
3063--
3064-- Name: users_emails_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3065--
3066
3067ALTER TABLE ONLY users_emails
61ec461c 3068 ADD CONSTRAINT users_emails_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
439d364e
MT
3069
3070
3071--
3072-- Name: users_permissions_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3073--
3074
3075ALTER TABLE ONLY users_permissions
61ec461c 3076 ADD CONSTRAINT users_permissions_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
439d364e
MT
3077
3078
64316541
MT
3079--
3080-- PostgreSQL database dump complete
3081--
9050c160 3082