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