]> git.ipfire.org Git - people/jschlag/pbs.git/blame - src/database.sql
Allow deleting files after a certain time from the filesystem
[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,
f835411e
MT
566 free_space bigint DEFAULT 0 NOT NULL,
567 host_key_id text,
e704b8e2 568 time_created timestamp without time zone DEFAULT now() NOT NULL,
f835411e
MT
569 time_updated timestamp without time zone,
570 time_keepalive timestamp without time zone,
64316541
MT
571 loadavg1 double precision,
572 loadavg5 double precision,
573 loadavg15 double precision,
f835411e
MT
574 mem_total bigint,
575 mem_free bigint,
576 swap_total bigint,
577 swap_free bigint,
578 space_free bigint
64316541 579);
9050c160 580
64316541
MT
581
582ALTER TABLE builders OWNER TO pakfire;
9050c160 583
9050c160 584--
64316541 585-- Name: builders_history; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
9050c160
MT
586--
587
64316541 588CREATE TABLE builders_history (
f835411e
MT
589 id integer NOT NULL,
590 builder_id integer NOT NULL,
64316541 591 action builders_history_action NOT NULL,
f835411e
MT
592 user_id integer,
593 "time" timestamp without time zone NOT NULL
64316541
MT
594);
595
9050c160 596
64316541 597ALTER TABLE builders_history OWNER TO pakfire;
9050c160
MT
598
599--
64316541 600-- Name: builders_history_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
9050c160
MT
601--
602
64316541
MT
603CREATE SEQUENCE builders_history_id_seq
604 START WITH 1
605 INCREMENT BY 1
606 NO MINVALUE
607 NO MAXVALUE
608 CACHE 1;
9050c160 609
64316541
MT
610
611ALTER TABLE builders_history_id_seq OWNER TO pakfire;
9050c160
MT
612
613--
64316541 614-- Name: builders_history_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
9050c160
MT
615--
616
64316541 617ALTER SEQUENCE builders_history_id_seq OWNED BY builders_history.id;
9050c160 618
9050c160
MT
619
620--
64316541 621-- Name: builders_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
9050c160
MT
622--
623
64316541
MT
624CREATE SEQUENCE builders_id_seq
625 START WITH 1
626 INCREMENT BY 1
627 NO MINVALUE
628 NO MAXVALUE
629 CACHE 1;
630
9050c160 631
64316541 632ALTER TABLE builders_id_seq OWNER TO pakfire;
9050c160
MT
633
634--
64316541 635-- Name: builders_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
9050c160
MT
636--
637
64316541 638ALTER SEQUENCE builders_id_seq OWNED BY builders.id;
9050c160 639
9050c160 640
9050c160 641--
64316541 642-- Name: builds; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
9050c160
MT
643--
644
64316541 645CREATE TABLE builds (
f835411e
MT
646 id integer NOT NULL,
647 uuid text NOT NULL,
648 pkg_id integer NOT NULL,
64316541 649 type builds_type DEFAULT 'release'::builds_type NOT NULL,
cb866740 650 state text DEFAULT 'building'::text NOT NULL,
64316541
MT
651 severity builds_severity,
652 message text,
4f90cf84 653 time_created timestamp without time zone DEFAULT now() NOT NULL,
f835411e
MT
654 update_year integer,
655 update_num integer,
656 depends_on integer,
657 distro_id integer NOT NULL,
658 owner_id integer,
f835411e 659 priority integer DEFAULT 0 NOT NULL,
4f90cf84 660 auto_move boolean DEFAULT false NOT NULL
64316541
MT
661);
662
9050c160 663
64316541 664ALTER TABLE builds OWNER TO pakfire;
9050c160
MT
665
666--
64316541 667-- Name: builds_bugs; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
9050c160
MT
668--
669
64316541 670CREATE TABLE builds_bugs (
f835411e
MT
671 id integer NOT NULL,
672 build_id integer NOT NULL,
673 bug_id integer NOT NULL
64316541
MT
674);
675
9050c160 676
64316541 677ALTER TABLE builds_bugs OWNER TO pakfire;
9050c160
MT
678
679--
64316541 680-- Name: builds_bugs_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
9050c160
MT
681--
682
64316541
MT
683CREATE SEQUENCE builds_bugs_id_seq
684 START WITH 1
685 INCREMENT BY 1
686 NO MINVALUE
687 NO MAXVALUE
688 CACHE 1;
9050c160 689
64316541
MT
690
691ALTER TABLE builds_bugs_id_seq OWNER TO pakfire;
9050c160
MT
692
693--
64316541 694-- Name: builds_bugs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
9050c160
MT
695--
696
64316541 697ALTER SEQUENCE builds_bugs_id_seq OWNED BY builds_bugs.id;
9050c160 698
9050c160
MT
699
700--
64316541 701-- Name: builds_bugs_updates; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
9050c160
MT
702--
703
64316541 704CREATE TABLE builds_bugs_updates (
f835411e
MT
705 id integer NOT NULL,
706 bug_id integer NOT NULL,
707 status text,
708 resolution text,
64316541 709 comment text,
f835411e 710 "time" timestamp without time zone NOT NULL,
fd43d5e1 711 error boolean DEFAULT false NOT NULL,
64316541
MT
712 error_msg text
713);
714
9050c160 715
64316541 716ALTER TABLE builds_bugs_updates OWNER TO pakfire;
9050c160
MT
717
718--
64316541 719-- Name: builds_bugs_updates_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
9050c160
MT
720--
721
64316541
MT
722CREATE SEQUENCE builds_bugs_updates_id_seq
723 START WITH 1
724 INCREMENT BY 1
725 NO MINVALUE
726 NO MAXVALUE
727 CACHE 1;
728
9050c160 729
64316541 730ALTER TABLE builds_bugs_updates_id_seq OWNER TO pakfire;
9050c160
MT
731
732--
64316541 733-- Name: builds_bugs_updates_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
9050c160
MT
734--
735
64316541 736ALTER SEQUENCE builds_bugs_updates_id_seq OWNED BY builds_bugs_updates.id;
189ba95b 737
189ba95b
MT
738
739--
64316541 740-- Name: builds_comments; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
189ba95b 741--
189ba95b 742
64316541 743CREATE TABLE builds_comments (
f835411e
MT
744 id integer NOT NULL,
745 build_id integer NOT NULL,
746 user_id integer NOT NULL,
64316541 747 text text NOT NULL,
d31d17af 748 score integer NOT NULL,
f835411e
MT
749 time_created timestamp without time zone NOT NULL,
750 time_updated timestamp without time zone
64316541
MT
751);
752
189ba95b 753
64316541 754ALTER TABLE builds_comments OWNER TO pakfire;
189ba95b
MT
755
756--
64316541 757-- Name: builds_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
189ba95b 758--
189ba95b 759
64316541
MT
760CREATE SEQUENCE builds_comments_id_seq
761 START WITH 1
762 INCREMENT BY 1
763 NO MINVALUE
764 NO MAXVALUE
765 CACHE 1;
766
767
768ALTER TABLE builds_comments_id_seq OWNER TO pakfire;
769
770--
771-- Name: builds_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
772--
773
774ALTER SEQUENCE builds_comments_id_seq OWNED BY builds_comments.id;
775
776
777--
778-- Name: builds_history; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
779--
780
781CREATE TABLE builds_history (
f835411e
MT
782 id integer NOT NULL,
783 build_id integer NOT NULL,
64316541 784 action builds_history_action NOT NULL,
f835411e
MT
785 user_id integer,
786 "time" timestamp without time zone NOT NULL,
787 bug_id integer
64316541
MT
788);
789
790
791ALTER TABLE builds_history OWNER TO pakfire;
792
793--
794-- Name: builds_history_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
795--
796
797CREATE SEQUENCE builds_history_id_seq
798 START WITH 1
799 INCREMENT BY 1
800 NO MINVALUE
801 NO MAXVALUE
802 CACHE 1;
803
804
805ALTER TABLE builds_history_id_seq OWNER TO pakfire;
806
807--
808-- Name: builds_history_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
809--
810
811ALTER SEQUENCE builds_history_id_seq OWNED BY builds_history.id;
812
813
814--
815-- Name: builds_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
816--
817
818CREATE SEQUENCE builds_id_seq
819 START WITH 1
820 INCREMENT BY 1
821 NO MINVALUE
822 NO MAXVALUE
823 CACHE 1;
824
825
826ALTER TABLE builds_id_seq OWNER TO pakfire;
827
828--
829-- Name: builds_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
830--
831
832ALTER SEQUENCE builds_id_seq OWNED BY builds.id;
833
834
fd43d5e1
MT
835--
836-- Name: jobs; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
837--
838
839CREATE TABLE jobs (
840 id integer NOT NULL,
841 uuid text NOT NULL,
fd43d5e1
MT
842 build_id integer NOT NULL,
843 state jobs_state DEFAULT 'new'::jobs_state NOT NULL,
844 arch text NOT NULL,
96cc81de 845 time_created timestamp without time zone DEFAULT now() NOT NULL,
fd43d5e1
MT
846 time_started timestamp without time zone,
847 time_finished timestamp without time zone,
848 start_not_before timestamp without time zone,
849 builder_id integer,
fd43d5e1 850 aborted_state integer DEFAULT 0 NOT NULL,
4f90cf84
MT
851 message text,
852 test boolean DEFAULT true NOT NULL,
a08fbdef 853 superseeded_by integer
fd43d5e1
MT
854);
855
856
857ALTER TABLE jobs OWNER TO pakfire;
858
64316541
MT
859--
860-- Name: builds_times; Type: VIEW; Schema: public; Owner: pakfire
861--
862
863CREATE VIEW builds_times AS
4f90cf84 864 SELECT jobs.build_id,
3d743a8e 865 jobs.arch,
64316541 866 (jobs.time_finished - jobs.time_started) AS duration
4f90cf84 867 FROM jobs
a08fbdef 868 WHERE ((jobs.test IS FALSE) AND (jobs.state = 'finished'::jobs_state));
64316541
MT
869
870
871ALTER TABLE builds_times OWNER TO pakfire;
872
873--
874-- Name: builds_watchers; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
875--
876
877CREATE TABLE builds_watchers (
f835411e
MT
878 id integer NOT NULL,
879 build_id integer NOT NULL,
880 user_id integer NOT NULL
64316541
MT
881);
882
883
884ALTER TABLE builds_watchers OWNER TO pakfire;
885
886--
887-- Name: builds_watchers_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
888--
889
890CREATE SEQUENCE builds_watchers_id_seq
891 START WITH 1
892 INCREMENT BY 1
893 NO MINVALUE
894 NO MAXVALUE
895 CACHE 1;
896
897
898ALTER TABLE builds_watchers_id_seq OWNER TO pakfire;
899
900--
901-- Name: builds_watchers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
902--
903
904ALTER SEQUENCE builds_watchers_id_seq OWNED BY builds_watchers.id;
905
906
907--
908-- Name: distributions; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
909--
910
911CREATE TABLE distributions (
f835411e
MT
912 id integer NOT NULL,
913 name text NOT NULL,
914 sname text NOT NULL,
915 slogan text NOT NULL,
64316541 916 description text,
f835411e
MT
917 vendor text NOT NULL,
918 contact text,
e459cbba
MT
919 tag text NOT NULL,
920 deleted boolean DEFAULT false NOT NULL
64316541
MT
921);
922
923
924ALTER TABLE distributions OWNER TO pakfire;
925
e459cbba
MT
926--
927-- Name: distributions_arches; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
928--
929
930CREATE TABLE distributions_arches (
931 id integer NOT NULL,
932 distro_id integer NOT NULL,
933 arch text NOT NULL
934);
935
936
937ALTER TABLE distributions_arches OWNER TO pakfire;
938
64316541
MT
939--
940-- Name: distributions_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
941--
942
943CREATE SEQUENCE distributions_id_seq
944 START WITH 1
945 INCREMENT BY 1
946 NO MINVALUE
947 NO MAXVALUE
948 CACHE 1;
949
950
951ALTER TABLE distributions_id_seq OWNER TO pakfire;
952
953--
954-- Name: distributions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
955--
956
957ALTER SEQUENCE distributions_id_seq OWNED BY distributions.id;
958
959
64316541
MT
960--
961-- Name: distro_arches_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
962--
963
964CREATE SEQUENCE distro_arches_id_seq
965 START WITH 1
966 INCREMENT BY 1
967 NO MINVALUE
968 NO MAXVALUE
969 CACHE 1;
970
971
972ALTER TABLE distro_arches_id_seq OWNER TO pakfire;
973
974--
975-- Name: distro_arches_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
976--
977
e459cbba 978ALTER SEQUENCE distro_arches_id_seq OWNED BY distributions_arches.id;
64316541
MT
979
980
981--
982-- Name: filelists; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
983--
984
985CREATE TABLE filelists (
f835411e
MT
986 pkg_id integer NOT NULL,
987 name text NOT NULL,
64316541 988 size bigint NOT NULL,
f835411e
MT
989 hash_sha512 text,
990 type integer NOT NULL,
4f90cf84 991 config boolean NOT NULL,
f835411e
MT
992 mode integer NOT NULL,
993 "user" text NOT NULL,
994 "group" text NOT NULL,
599c1a33 995 mtime timestamp without time zone NOT NULL,
f835411e 996 capabilities text
64316541
MT
997);
998
999
1000ALTER TABLE filelists OWNER TO pakfire;
1001
1002--
1003-- Name: images_types; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1004--
1005
1006CREATE TABLE images_types (
f835411e
MT
1007 id integer NOT NULL,
1008 type text NOT NULL
64316541
MT
1009);
1010
1011
1012ALTER TABLE images_types OWNER TO pakfire;
1013
1014--
1015-- Name: images_types_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1016--
1017
1018CREATE SEQUENCE images_types_id_seq
1019 START WITH 1
1020 INCREMENT BY 1
1021 NO MINVALUE
1022 NO MAXVALUE
1023 CACHE 1;
1024
1025
1026ALTER TABLE images_types_id_seq OWNER TO pakfire;
1027
1028--
1029-- Name: images_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1030--
1031
1032ALTER SEQUENCE images_types_id_seq OWNED BY images_types.id;
1033
1034
fd43d5e1
MT
1035--
1036-- Name: jobs_active; Type: VIEW; Schema: public; Owner: pakfire
1037--
1038
1039CREATE VIEW jobs_active AS
1040 SELECT jobs.id,
1041 jobs.uuid,
fd43d5e1
MT
1042 jobs.build_id,
1043 jobs.state,
1044 jobs.arch,
1045 jobs.time_created,
1046 jobs.time_started,
1047 jobs.time_finished,
1048 jobs.start_not_before,
1049 jobs.builder_id,
fd43d5e1
MT
1050 jobs.aborted_state,
1051 jobs.message
1052 FROM jobs
1053 WHERE (jobs.state = ANY (ARRAY['dispatching'::jobs_state, 'running'::jobs_state, 'uploading'::jobs_state]))
1054 ORDER BY jobs.time_started;
1055
1056
1057ALTER TABLE jobs_active OWNER TO pakfire;
1058
64316541
MT
1059--
1060-- Name: jobs_buildroots; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1061--
1062
1063CREATE TABLE jobs_buildroots (
f835411e 1064 job_id integer NOT NULL,
f835411e
MT
1065 pkg_uuid text NOT NULL,
1066 pkg_name text NOT NULL
64316541
MT
1067);
1068
1069
1070ALTER TABLE jobs_buildroots OWNER TO pakfire;
1071
1072--
1073-- Name: jobs_history; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1074--
1075
1076CREATE TABLE jobs_history (
f835411e 1077 job_id integer NOT NULL,
64316541
MT
1078 action jobs_history_action NOT NULL,
1079 state jobs_history_state,
f835411e
MT
1080 user_id integer,
1081 "time" timestamp without time zone NOT NULL,
1082 builder_id integer,
1083 test_job_id integer
64316541
MT
1084);
1085
1086
1087ALTER TABLE jobs_history OWNER TO pakfire;
1088
1089--
1090-- Name: jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1091--
1092
1093CREATE SEQUENCE jobs_id_seq
1094 START WITH 1
1095 INCREMENT BY 1
1096 NO MINVALUE
1097 NO MAXVALUE
1098 CACHE 1;
1099
1100
1101ALTER TABLE jobs_id_seq OWNER TO pakfire;
1102
1103--
1104-- Name: jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1105--
1106
1107ALTER SEQUENCE jobs_id_seq OWNED BY jobs.id;
1108
1109
1110--
1111-- Name: jobs_packages; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1112--
1113
1114CREATE TABLE jobs_packages (
f835411e
MT
1115 id integer NOT NULL,
1116 job_id integer NOT NULL,
1117 pkg_id integer NOT NULL
64316541
MT
1118);
1119
1120
1121ALTER TABLE jobs_packages OWNER TO pakfire;
1122
1123--
1124-- Name: jobs_packages_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1125--
1126
1127CREATE SEQUENCE jobs_packages_id_seq
1128 START WITH 1
1129 INCREMENT BY 1
1130 NO MINVALUE
1131 NO MAXVALUE
1132 CACHE 1;
1133
1134
1135ALTER TABLE jobs_packages_id_seq OWNER TO pakfire;
1136
1137--
1138-- Name: jobs_packages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1139--
1140
1141ALTER SEQUENCE jobs_packages_id_seq OWNED BY jobs_packages.id;
1142
1143
1144--
1145-- Name: jobs_queue; Type: VIEW; Schema: public; Owner: pakfire
1146--
1147
1148CREATE VIEW jobs_queue AS
fd43d5e1
MT
1149 WITH queue AS (
1150 SELECT jobs.id,
f93059e0 1151 rank() OVER (ORDER BY (NOT jobs.test), builds.priority DESC, jobs.time_created) AS rank
fd43d5e1
MT
1152 FROM (jobs
1153 LEFT JOIN builds ON ((jobs.build_id = builds.id)))
1154 WHERE (jobs.state = 'pending'::jobs_state)
1155 )
1156 SELECT queue.id AS job_id,
1157 queue.rank
1158 FROM queue;
64316541
MT
1159
1160
1161ALTER TABLE jobs_queue OWNER TO pakfire;
1162
1163--
1164-- Name: jobs_repos; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1165--
1166
1167CREATE TABLE jobs_repos (
f835411e
MT
1168 job_id integer NOT NULL,
1169 repo_id integer NOT NULL
64316541
MT
1170);
1171
1172
1173ALTER TABLE jobs_repos OWNER TO pakfire;
1174
64316541
MT
1175--
1176-- Name: keys; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1177--
1178
1179CREATE TABLE keys (
f835411e
MT
1180 id integer NOT NULL,
1181 fingerprint text NOT NULL,
1182 uids text NOT NULL,
64316541
MT
1183 data text NOT NULL
1184);
1185
1186
1187ALTER TABLE keys OWNER TO pakfire;
1188
1189--
1190-- Name: keys_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1191--
1192
1193CREATE SEQUENCE keys_id_seq
1194 START WITH 1
1195 INCREMENT BY 1
1196 NO MINVALUE
1197 NO MAXVALUE
1198 CACHE 1;
1199
1200
1201ALTER TABLE keys_id_seq OWNER TO pakfire;
1202
1203--
1204-- Name: keys_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1205--
1206
1207ALTER SEQUENCE keys_id_seq OWNED BY keys.id;
1208
1209
1210--
1211-- Name: keys_subkeys; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1212--
1213
1214CREATE TABLE keys_subkeys (
f835411e
MT
1215 id integer NOT NULL,
1216 key_id integer NOT NULL,
1217 fingerprint text NOT NULL,
1218 time_created timestamp without time zone NOT NULL,
1219 time_expires timestamp without time zone,
1220 algo text
64316541
MT
1221);
1222
1223
1224ALTER TABLE keys_subkeys OWNER TO pakfire;
1225
1226--
1227-- Name: keys_subkeys_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1228--
1229
1230CREATE SEQUENCE keys_subkeys_id_seq
1231 START WITH 1
1232 INCREMENT BY 1
1233 NO MINVALUE
1234 NO MAXVALUE
1235 CACHE 1;
1236
1237
1238ALTER TABLE keys_subkeys_id_seq OWNER TO pakfire;
1239
1240--
1241-- Name: keys_subkeys_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1242--
1243
1244ALTER SEQUENCE keys_subkeys_id_seq OWNED BY keys_subkeys.id;
1245
1246
1247--
1248-- Name: logfiles; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1249--
1250
1251CREATE TABLE logfiles (
f835411e
MT
1252 id integer NOT NULL,
1253 job_id integer NOT NULL,
1254 path text NOT NULL,
64316541 1255 filesize bigint NOT NULL,
f835411e 1256 hash_sha512 text NOT NULL
64316541
MT
1257);
1258
1259
1260ALTER TABLE logfiles OWNER TO pakfire;
1261
1262--
1263-- Name: logfiles_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1264--
1265
1266CREATE SEQUENCE logfiles_id_seq
1267 START WITH 1
1268 INCREMENT BY 1
1269 NO MINVALUE
1270 NO MAXVALUE
1271 CACHE 1;
1272
1273
1274ALTER TABLE logfiles_id_seq OWNER TO pakfire;
1275
1276--
1277-- Name: logfiles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1278--
1279
1280ALTER SEQUENCE logfiles_id_seq OWNED BY logfiles.id;
1281
1282
1283--
1284-- Name: mirrors; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1285--
1286
1287CREATE TABLE mirrors (
f835411e
MT
1288 id integer NOT NULL,
1289 hostname text NOT NULL,
1290 path text NOT NULL,
1291 owner text,
1292 contact text,
3163c789
MT
1293 deleted boolean DEFAULT false NOT NULL,
1294 supports_https boolean DEFAULT false NOT NULL
64316541
MT
1295);
1296
1297
1298ALTER TABLE mirrors OWNER TO pakfire;
1299
c660ff59
MT
1300--
1301-- Name: mirrors_checks; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1302--
1303
1304CREATE TABLE mirrors_checks (
1305 id integer NOT NULL,
1306 mirror_id integer NOT NULL,
1307 "timestamp" timestamp without time zone DEFAULT now() NOT NULL,
1308 response_time double precision,
1309 http_status integer,
1310 last_sync_at timestamp without time zone,
1311 status text DEFAULT 'OK'::text NOT NULL
1312);
1313
1314
1315ALTER TABLE mirrors_checks OWNER TO pakfire;
1316
1317--
1318-- Name: mirrors_checks_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1319--
1320
1321CREATE SEQUENCE mirrors_checks_id_seq
1322 START WITH 1
1323 INCREMENT BY 1
1324 NO MINVALUE
1325 NO MAXVALUE
1326 CACHE 1;
1327
1328
1329ALTER TABLE mirrors_checks_id_seq OWNER TO pakfire;
1330
1331--
1332-- Name: mirrors_checks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1333--
1334
1335ALTER SEQUENCE mirrors_checks_id_seq OWNED BY mirrors_checks.id;
1336
1337
64316541
MT
1338--
1339-- Name: mirrors_history; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1340--
1341
1342CREATE TABLE mirrors_history (
f835411e
MT
1343 id integer NOT NULL,
1344 mirror_id integer NOT NULL,
64316541 1345 action mirrors_history_action NOT NULL,
f835411e
MT
1346 user_id integer,
1347 "time" timestamp without time zone NOT NULL
64316541
MT
1348);
1349
1350
1351ALTER TABLE mirrors_history OWNER TO pakfire;
1352
1353--
1354-- Name: mirrors_history_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1355--
1356
1357CREATE SEQUENCE mirrors_history_id_seq
1358 START WITH 1
1359 INCREMENT BY 1
1360 NO MINVALUE
1361 NO MAXVALUE
1362 CACHE 1;
1363
1364
1365ALTER TABLE mirrors_history_id_seq OWNER TO pakfire;
1366
1367--
1368-- Name: mirrors_history_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1369--
1370
1371ALTER SEQUENCE mirrors_history_id_seq OWNED BY mirrors_history.id;
1372
1373
1374--
1375-- Name: mirrors_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1376--
1377
1378CREATE SEQUENCE mirrors_id_seq
1379 START WITH 1
1380 INCREMENT BY 1
1381 NO MINVALUE
1382 NO MAXVALUE
1383 CACHE 1;
1384
1385
1386ALTER TABLE mirrors_id_seq OWNER TO pakfire;
1387
1388--
1389-- Name: mirrors_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1390--
1391
1392ALTER SEQUENCE mirrors_id_seq OWNED BY mirrors.id;
1393
1394
cb866740
MT
1395--
1396-- Name: packages; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1397--
1398
1399CREATE TABLE packages (
1400 id integer NOT NULL,
1401 name text NOT NULL,
1402 epoch integer NOT NULL,
1403 version text NOT NULL,
1404 release text NOT NULL,
1405 type packages_type NOT NULL,
1406 arch text NOT NULL,
1407 groups text NOT NULL,
1408 maintainer text NOT NULL,
1409 license text NOT NULL,
1410 url text NOT NULL,
1411 summary text NOT NULL,
1412 description text NOT NULL,
1413 size bigint NOT NULL,
1414 supported_arches text,
1415 uuid text NOT NULL,
1416 commit_id integer,
1417 build_id text NOT NULL,
1418 build_host text NOT NULL,
1419 build_time timestamp without time zone NOT NULL,
1420 path text NOT NULL,
1421 filesize bigint NOT NULL,
1422 hash_sha512 text NOT NULL
1423);
1424
1425
1426ALTER TABLE packages OWNER TO pakfire;
1427
64316541
MT
1428--
1429-- Name: packages_deps; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1430--
1431
1432CREATE TABLE packages_deps (
f835411e 1433 pkg_id integer NOT NULL,
64316541 1434 type packages_deps_type NOT NULL,
f835411e 1435 what text NOT NULL
64316541
MT
1436);
1437
1438
1439ALTER TABLE packages_deps OWNER TO pakfire;
1440
1441--
1442-- Name: packages_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1443--
1444
1445CREATE SEQUENCE packages_id_seq
1446 START WITH 1
1447 INCREMENT BY 1
1448 NO MINVALUE
1449 NO MAXVALUE
1450 CACHE 1;
1451
1452
1453ALTER TABLE packages_id_seq OWNER TO pakfire;
1454
1455--
1456-- Name: packages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1457--
1458
1459ALTER SEQUENCE packages_id_seq OWNED BY packages.id;
1460
1461
1462--
1463-- Name: packages_properties; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1464--
1465
1466CREATE TABLE packages_properties (
f835411e
MT
1467 id integer NOT NULL,
1468 name text NOT NULL,
024d6076 1469 critical_path boolean DEFAULT false NOT NULL,
f835411e 1470 priority integer DEFAULT 0 NOT NULL
64316541
MT
1471);
1472
1473
1474ALTER TABLE packages_properties OWNER TO pakfire;
1475
1476--
1477-- Name: packages_properties_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1478--
1479
1480CREATE SEQUENCE packages_properties_id_seq
1481 START WITH 1
1482 INCREMENT BY 1
1483 NO MINVALUE
1484 NO MAXVALUE
1485 CACHE 1;
1486
1487
1488ALTER TABLE packages_properties_id_seq OWNER TO pakfire;
1489
1490--
1491-- Name: packages_properties_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1492--
1493
1494ALTER SEQUENCE packages_properties_id_seq OWNED BY packages_properties.id;
1495
1496
1497--
1498-- Name: queue_delete; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1499--
1500
1501CREATE TABLE queue_delete (
f835411e 1502 id integer NOT NULL,
5c9daa86
MT
1503 path text NOT NULL,
1504 not_before timestamp without time zone
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
64316541
MT
1735--
1736-- Name: sources; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1737--
1738
1739CREATE TABLE sources (
f835411e
MT
1740 id integer NOT NULL,
1741 name text NOT NULL,
1742 identifier text NOT NULL,
1743 url text NOT NULL,
1744 gitweb text,
1745 revision text NOT NULL,
1746 branch text NOT NULL,
1747 updated timestamp without time zone,
1748 distro_id integer NOT NULL
64316541
MT
1749);
1750
1751
1752ALTER TABLE sources OWNER TO pakfire;
1753
1754--
1755-- Name: sources_commits; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1756--
1757
1758CREATE TABLE sources_commits (
f835411e
MT
1759 id integer NOT NULL,
1760 source_id integer NOT NULL,
1761 revision text NOT NULL,
1762 author text NOT NULL,
1763 committer text NOT NULL,
1764 subject text NOT NULL,
64316541 1765 body text NOT NULL,
f835411e 1766 date timestamp without time zone NOT NULL,
cb866740
MT
1767 state sources_commits_state DEFAULT 'pending'::sources_commits_state NOT NULL,
1768 imported_at timestamp without time zone DEFAULT now() NOT NULL
64316541
MT
1769);
1770
1771
1772ALTER TABLE sources_commits OWNER TO pakfire;
1773
1774--
1775-- Name: sources_commits_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1776--
1777
1778CREATE SEQUENCE sources_commits_id_seq
1779 START WITH 1
1780 INCREMENT BY 1
1781 NO MINVALUE
1782 NO MAXVALUE
1783 CACHE 1;
1784
1785
1786ALTER TABLE sources_commits_id_seq OWNER TO pakfire;
1787
1788--
1789-- Name: sources_commits_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1790--
1791
1792ALTER SEQUENCE sources_commits_id_seq OWNED BY sources_commits.id;
1793
1794
1795--
1796-- Name: sources_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1797--
1798
1799CREATE SEQUENCE sources_id_seq
1800 START WITH 1
1801 INCREMENT BY 1
1802 NO MINVALUE
1803 NO MAXVALUE
1804 CACHE 1;
1805
1806
1807ALTER TABLE sources_id_seq OWNER TO pakfire;
1808
1809--
1810-- Name: sources_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1811--
1812
1813ALTER SEQUENCE sources_id_seq OWNED BY sources.id;
1814
1815
1816--
1817-- Name: uploads; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1818--
1819
1820CREATE TABLE uploads (
f835411e
MT
1821 id integer NOT NULL,
1822 uuid text NOT NULL,
1823 user_id integer,
1824 builder_id integer,
1825 filename text NOT NULL,
1826 hash text NOT NULL,
64316541 1827 size bigint NOT NULL,
f835411e 1828 progress bigint DEFAULT 0 NOT NULL,
024d6076 1829 finished boolean DEFAULT false NOT NULL,
f835411e
MT
1830 time_started timestamp without time zone DEFAULT now() NOT NULL,
1831 time_finished timestamp without time zone
64316541
MT
1832);
1833
1834
1835ALTER TABLE uploads OWNER TO pakfire;
1836
1837--
1838-- Name: uploads_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1839--
1840
1841CREATE SEQUENCE uploads_id_seq
1842 START WITH 1
1843 INCREMENT BY 1
1844 NO MINVALUE
1845 NO MAXVALUE
1846 CACHE 1;
1847
1848
1849ALTER TABLE uploads_id_seq OWNER TO pakfire;
1850
1851--
1852-- Name: uploads_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1853--
1854
1855ALTER SEQUENCE uploads_id_seq OWNED BY uploads.id;
1856
1857
1858--
1859-- Name: user_messages; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1860--
1861
1862CREATE TABLE user_messages (
f835411e
MT
1863 id integer NOT NULL,
1864 frm text NOT NULL,
1865 "to" text NOT NULL,
1866 subject text NOT NULL,
64316541 1867 text text NOT NULL,
f835411e 1868 time_added timestamp without time zone DEFAULT now() NOT NULL
64316541
MT
1869);
1870
1871
1872ALTER TABLE user_messages OWNER TO pakfire;
1873
1874--
1875-- Name: user_messages_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1876--
1877
1878CREATE SEQUENCE user_messages_id_seq
1879 START WITH 1
1880 INCREMENT BY 1
1881 NO MINVALUE
1882 NO MAXVALUE
1883 CACHE 1;
1884
1885
1886ALTER TABLE user_messages_id_seq OWNER TO pakfire;
1887
1888--
1889-- Name: user_messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1890--
1891
1892ALTER SEQUENCE user_messages_id_seq OWNED BY user_messages.id;
1893
1894
1895--
1896-- Name: users; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1897--
1898
1899CREATE TABLE users (
f835411e
MT
1900 id integer NOT NULL,
1901 name text NOT NULL,
1902 realname text,
1903 passphrase text NOT NULL,
64316541 1904 state users_state NOT NULL,
f835411e
MT
1905 locale text,
1906 timezone text,
64316541 1907 activated users_activated DEFAULT 'N'::users_activated NOT NULL,
f835411e 1908 activation_code text,
64316541 1909 deleted users_deleted DEFAULT 'N'::users_deleted NOT NULL,
f835411e 1910 registered timestamp without time zone DEFAULT now() NOT NULL
64316541
MT
1911);
1912
1913
1914ALTER TABLE users OWNER TO pakfire;
1915
1916--
1917-- Name: users_emails; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1918--
1919
1920CREATE TABLE users_emails (
f835411e
MT
1921 id integer NOT NULL,
1922 user_id integer NOT NULL,
1923 email text NOT NULL,
64316541
MT
1924 "primary" users_emails_primary DEFAULT 'N'::users_emails_primary NOT NULL
1925);
1926
1927
1928ALTER TABLE users_emails OWNER TO pakfire;
1929
1930--
1931-- Name: users_emails_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1932--
1933
1934CREATE SEQUENCE users_emails_id_seq
1935 START WITH 1
1936 INCREMENT BY 1
1937 NO MINVALUE
1938 NO MAXVALUE
1939 CACHE 1;
1940
1941
1942ALTER TABLE users_emails_id_seq OWNER TO pakfire;
1943
1944--
1945-- Name: users_emails_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1946--
1947
1948ALTER SEQUENCE users_emails_id_seq OWNED BY users_emails.id;
1949
1950
1951--
1952-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1953--
1954
1955CREATE SEQUENCE users_id_seq
1956 START WITH 1
1957 INCREMENT BY 1
1958 NO MINVALUE
1959 NO MAXVALUE
1960 CACHE 1;
1961
1962
1963ALTER TABLE users_id_seq OWNER TO pakfire;
1964
1965--
1966-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
1967--
1968
1969ALTER SEQUENCE users_id_seq OWNED BY users.id;
1970
1971
1972--
1973-- Name: users_permissions; Type: TABLE; Schema: public; Owner: pakfire; Tablespace:
1974--
1975
1976CREATE TABLE users_permissions (
f835411e
MT
1977 id integer NOT NULL,
1978 user_id integer NOT NULL,
64316541
MT
1979 create_scratch_builds users_permissions_create_scratch_builds DEFAULT 'N'::users_permissions_create_scratch_builds NOT NULL,
1980 maintain_builders users_permissions_maintain_builders DEFAULT 'N'::users_permissions_maintain_builders NOT NULL,
1981 manage_critical_path users_permissions_manage_critical_path DEFAULT 'N'::users_permissions_manage_critical_path NOT NULL,
1982 manage_mirrors users_permissions_manage_mirrors DEFAULT 'N'::users_permissions_manage_mirrors NOT NULL,
1983 vote users_permissions_vote DEFAULT 'N'::users_permissions_vote NOT NULL
1984);
1985
1986
1987ALTER TABLE users_permissions OWNER TO pakfire;
1988
1989--
1990-- Name: users_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
1991--
1992
1993CREATE SEQUENCE users_permissions_id_seq
1994 START WITH 1
1995 INCREMENT BY 1
1996 NO MINVALUE
1997 NO MAXVALUE
1998 CACHE 1;
1999
2000
2001ALTER TABLE users_permissions_id_seq OWNER TO pakfire;
2002
2003--
2004-- Name: users_permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
2005--
2006
2007ALTER SEQUENCE users_permissions_id_seq OWNED BY users_permissions.id;
2008
2009
2010--
2011-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2012--
2013
2014ALTER TABLE ONLY arches ALTER COLUMN id SET DEFAULT nextval('arches_id_seq'::regclass);
2015
2016
2017--
2018-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2019--
2020
2021ALTER TABLE ONLY builders ALTER COLUMN id SET DEFAULT nextval('builders_id_seq'::regclass);
2022
2023
64316541
MT
2024--
2025-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2026--
2027
2028ALTER TABLE ONLY builders_history ALTER COLUMN id SET DEFAULT nextval('builders_history_id_seq'::regclass);
2029
2030
2031--
2032-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2033--
2034
2035ALTER TABLE ONLY builds ALTER COLUMN id SET DEFAULT nextval('builds_id_seq'::regclass);
2036
2037
2038--
2039-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2040--
2041
2042ALTER TABLE ONLY builds_bugs ALTER COLUMN id SET DEFAULT nextval('builds_bugs_id_seq'::regclass);
2043
2044
2045--
2046-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2047--
2048
2049ALTER TABLE ONLY builds_bugs_updates ALTER COLUMN id SET DEFAULT nextval('builds_bugs_updates_id_seq'::regclass);
2050
2051
2052--
2053-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2054--
2055
2056ALTER TABLE ONLY builds_comments ALTER COLUMN id SET DEFAULT nextval('builds_comments_id_seq'::regclass);
2057
2058
2059--
2060-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2061--
2062
2063ALTER TABLE ONLY builds_history ALTER COLUMN id SET DEFAULT nextval('builds_history_id_seq'::regclass);
2064
2065
2066--
2067-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2068--
2069
2070ALTER TABLE ONLY builds_watchers ALTER COLUMN id SET DEFAULT nextval('builds_watchers_id_seq'::regclass);
2071
2072
2073--
2074-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2075--
2076
2077ALTER TABLE ONLY distributions ALTER COLUMN id SET DEFAULT nextval('distributions_id_seq'::regclass);
2078
2079
2080--
2081-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2082--
2083
e459cbba 2084ALTER TABLE ONLY distributions_arches ALTER COLUMN id SET DEFAULT nextval('distro_arches_id_seq'::regclass);
64316541
MT
2085
2086
2087--
2088-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2089--
2090
2091ALTER TABLE ONLY images_types ALTER COLUMN id SET DEFAULT nextval('images_types_id_seq'::regclass);
2092
2093
2094--
2095-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2096--
2097
2098ALTER TABLE ONLY jobs ALTER COLUMN id SET DEFAULT nextval('jobs_id_seq'::regclass);
2099
2100
2101--
2102-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2103--
2104
2105ALTER TABLE ONLY jobs_packages ALTER COLUMN id SET DEFAULT nextval('jobs_packages_id_seq'::regclass);
2106
2107
2108--
2109-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2110--
2111
2112ALTER TABLE ONLY keys ALTER COLUMN id SET DEFAULT nextval('keys_id_seq'::regclass);
2113
2114
2115--
2116-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2117--
2118
2119ALTER TABLE ONLY keys_subkeys ALTER COLUMN id SET DEFAULT nextval('keys_subkeys_id_seq'::regclass);
2120
2121
2122--
2123-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2124--
2125
2126ALTER TABLE ONLY logfiles ALTER COLUMN id SET DEFAULT nextval('logfiles_id_seq'::regclass);
2127
2128
2129--
2130-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2131--
2132
2133ALTER TABLE ONLY mirrors ALTER COLUMN id SET DEFAULT nextval('mirrors_id_seq'::regclass);
2134
2135
c660ff59
MT
2136--
2137-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2138--
2139
2140ALTER TABLE ONLY mirrors_checks ALTER COLUMN id SET DEFAULT nextval('mirrors_checks_id_seq'::regclass);
2141
2142
64316541
MT
2143--
2144-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2145--
2146
2147ALTER TABLE ONLY mirrors_history ALTER COLUMN id SET DEFAULT nextval('mirrors_history_id_seq'::regclass);
2148
2149
2150--
2151-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2152--
2153
2154ALTER TABLE ONLY packages ALTER COLUMN id SET DEFAULT nextval('packages_id_seq'::regclass);
2155
2156
2157--
2158-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2159--
2160
2161ALTER TABLE ONLY packages_properties ALTER COLUMN id SET DEFAULT nextval('packages_properties_id_seq'::regclass);
2162
2163
2164--
2165-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2166--
2167
2168ALTER TABLE ONLY queue_delete ALTER COLUMN id SET DEFAULT nextval('queue_delete_id_seq'::regclass);
2169
2170
2171--
2172-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2173--
2174
2175ALTER TABLE ONLY repositories ALTER COLUMN id SET DEFAULT nextval('repositories_id_seq'::regclass);
2176
2177
2178--
2179-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2180--
2181
2182ALTER TABLE ONLY repositories_aux ALTER COLUMN id SET DEFAULT nextval('repositories_aux_id_seq'::regclass);
2183
2184
2185--
2186-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2187--
2188
2189ALTER TABLE ONLY repositories_builds ALTER COLUMN id SET DEFAULT nextval('repositories_builds_id_seq'::regclass);
2190
2191
d2738057
MT
2192--
2193-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2194--
2195
2196ALTER TABLE ONLY sessions ALTER COLUMN id SET DEFAULT nextval('sessions_id_seq'::regclass);
2197
2198
64316541
MT
2199--
2200-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2201--
2202
2203ALTER TABLE ONLY sources ALTER COLUMN id SET DEFAULT nextval('sources_id_seq'::regclass);
2204
2205
2206--
2207-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2208--
2209
2210ALTER TABLE ONLY sources_commits ALTER COLUMN id SET DEFAULT nextval('sources_commits_id_seq'::regclass);
2211
2212
2213--
2214-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2215--
2216
2217ALTER TABLE ONLY uploads ALTER COLUMN id SET DEFAULT nextval('uploads_id_seq'::regclass);
2218
2219
2220--
2221-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2222--
2223
2224ALTER TABLE ONLY user_messages ALTER COLUMN id SET DEFAULT nextval('user_messages_id_seq'::regclass);
2225
2226
2227--
2228-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2229--
2230
2231ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
2232
2233
2234--
2235-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2236--
2237
2238ALTER TABLE ONLY users_emails ALTER COLUMN id SET DEFAULT nextval('users_emails_id_seq'::regclass);
2239
2240
2241--
2242-- Name: id; Type: DEFAULT; Schema: public; Owner: pakfire
2243--
2244
2245ALTER TABLE ONLY users_permissions ALTER COLUMN id SET DEFAULT nextval('users_permissions_id_seq'::regclass);
2246
2247
e704b8e2
MT
2248--
2249-- Name: arches_compat_unique; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2250--
2251
2252ALTER TABLE ONLY arches_compat
2253 ADD CONSTRAINT arches_compat_unique UNIQUE (native_arch, build_arch);
2254
2255
3d743a8e
MT
2256--
2257-- Name: arches_name; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2258--
2259
2260ALTER TABLE ONLY arches
2261 ADD CONSTRAINT arches_name UNIQUE (name);
2262
2263
64316541
MT
2264--
2265-- Name: idx_2197943_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2266--
2267
2268ALTER TABLE ONLY arches
2269 ADD CONSTRAINT idx_2197943_primary PRIMARY KEY (id);
2270
2271
2272--
2273-- Name: idx_2197954_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2274--
2275
2276ALTER TABLE ONLY builders
2277 ADD CONSTRAINT idx_2197954_primary PRIMARY KEY (id);
2278
2279
64316541
MT
2280--
2281-- Name: idx_2197982_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2282--
2283
2284ALTER TABLE ONLY builders_history
2285 ADD CONSTRAINT idx_2197982_primary PRIMARY KEY (id);
2286
2287
2288--
2289-- Name: idx_2197988_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2290--
2291
2292ALTER TABLE ONLY builds
2293 ADD CONSTRAINT idx_2197988_primary PRIMARY KEY (id);
2294
2295
2296--
2297-- Name: idx_2198002_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2298--
2299
2300ALTER TABLE ONLY builds_bugs
2301 ADD CONSTRAINT idx_2198002_primary PRIMARY KEY (id);
2302
2303
2304--
2305-- Name: idx_2198008_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2306--
2307
2308ALTER TABLE ONLY builds_bugs_updates
2309 ADD CONSTRAINT idx_2198008_primary PRIMARY KEY (id);
2310
2311
2312--
2313-- Name: idx_2198018_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2314--
2315
2316ALTER TABLE ONLY builds_comments
2317 ADD CONSTRAINT idx_2198018_primary PRIMARY KEY (id);
2318
2319
2320--
2321-- Name: idx_2198027_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2322--
2323
2324ALTER TABLE ONLY builds_history
2325 ADD CONSTRAINT idx_2198027_primary PRIMARY KEY (id);
2326
2327
2328--
2329-- Name: idx_2198033_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2330--
2331
2332ALTER TABLE ONLY builds_watchers
2333 ADD CONSTRAINT idx_2198033_primary PRIMARY KEY (id);
2334
2335
2336--
2337-- Name: idx_2198039_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2338--
2339
2340ALTER TABLE ONLY distributions
2341 ADD CONSTRAINT idx_2198039_primary PRIMARY KEY (id);
2342
2343
2344--
2345-- Name: idx_2198048_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2346--
2347
e459cbba 2348ALTER TABLE ONLY distributions_arches
64316541
MT
2349 ADD CONSTRAINT idx_2198048_primary PRIMARY KEY (id);
2350
2351
2352--
2353-- Name: idx_2198057_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2354--
2355
2356ALTER TABLE ONLY images_types
2357 ADD CONSTRAINT idx_2198057_primary PRIMARY KEY (id);
2358
2359
2360--
2361-- Name: idx_2198063_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2362--
2363
2364ALTER TABLE ONLY jobs
2365 ADD CONSTRAINT idx_2198063_primary PRIMARY KEY (id);
2366
2367
2368--
2369-- Name: idx_2198085_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2370--
2371
2372ALTER TABLE ONLY jobs_packages
2373 ADD CONSTRAINT idx_2198085_primary PRIMARY KEY (id);
2374
2375
2376--
2377-- Name: idx_2198094_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2378--
2379
2380ALTER TABLE ONLY keys
2381 ADD CONSTRAINT idx_2198094_primary PRIMARY KEY (id);
2382
2383
2384--
2385-- Name: idx_2198103_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2386--
2387
2388ALTER TABLE ONLY keys_subkeys
2389 ADD CONSTRAINT idx_2198103_primary PRIMARY KEY (id);
2390
2391
2392--
2393-- Name: idx_2198109_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2394--
2395
2396ALTER TABLE ONLY logfiles
2397 ADD CONSTRAINT idx_2198109_primary PRIMARY KEY (id);
2398
2399
2400--
2401-- Name: idx_2198115_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2402--
2403
2404ALTER TABLE ONLY mirrors
2405 ADD CONSTRAINT idx_2198115_primary PRIMARY KEY (id);
2406
2407
2408--
2409-- Name: idx_2198126_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2410--
2411
2412ALTER TABLE ONLY mirrors_history
2413 ADD CONSTRAINT idx_2198126_primary PRIMARY KEY (id);
2414
2415
2416--
2417-- Name: idx_2198132_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2418--
2419
2420ALTER TABLE ONLY packages
2421 ADD CONSTRAINT idx_2198132_primary PRIMARY KEY (id);
2422
2423
2424--
2425-- Name: idx_2198147_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2426--
2427
2428ALTER TABLE ONLY packages_properties
2429 ADD CONSTRAINT idx_2198147_primary PRIMARY KEY (id);
2430
2431
2432--
2433-- Name: idx_2198155_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2434--
2435
2436ALTER TABLE ONLY queue_delete
2437 ADD CONSTRAINT idx_2198155_primary PRIMARY KEY (id);
2438
2439
2440--
2441-- Name: idx_2198164_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2442--
2443
2444ALTER TABLE ONLY repositories
2445 ADD CONSTRAINT idx_2198164_primary PRIMARY KEY (id);
2446
2447
2448--
2449-- Name: idx_2198179_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2450--
2451
2452ALTER TABLE ONLY repositories_aux
2453 ADD CONSTRAINT idx_2198179_primary PRIMARY KEY (id);
2454
2455
2456--
2457-- Name: idx_2198189_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2458--
2459
2460ALTER TABLE ONLY repositories_builds
2461 ADD CONSTRAINT idx_2198189_primary PRIMARY KEY (id);
2462
2463
64316541
MT
2464--
2465-- Name: idx_2198213_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2466--
2467
2468ALTER TABLE ONLY sources
2469 ADD CONSTRAINT idx_2198213_primary PRIMARY KEY (id);
2470
2471
2472--
2473-- Name: idx_2198222_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2474--
2475
2476ALTER TABLE ONLY sources_commits
2477 ADD CONSTRAINT idx_2198222_primary PRIMARY KEY (id);
2478
2479
2480--
2481-- Name: idx_2198232_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2482--
2483
2484ALTER TABLE ONLY uploads
2485 ADD CONSTRAINT idx_2198232_primary PRIMARY KEY (id);
2486
2487
2488--
2489-- Name: idx_2198244_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2490--
2491
2492ALTER TABLE ONLY users
2493 ADD CONSTRAINT idx_2198244_primary PRIMARY KEY (id);
2494
2495
2496--
2497-- Name: idx_2198256_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2498--
2499
2500ALTER TABLE ONLY users_emails
2501 ADD CONSTRAINT idx_2198256_primary PRIMARY KEY (id);
2502
2503
2504--
2505-- Name: idx_2198263_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2506--
2507
2508ALTER TABLE ONLY users_permissions
2509 ADD CONSTRAINT idx_2198263_primary PRIMARY KEY (id);
2510
2511
2512--
2513-- Name: idx_2198274_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2514--
2515
2516ALTER TABLE ONLY user_messages
2517 ADD CONSTRAINT idx_2198274_primary PRIMARY KEY (id);
2518
2519
439d364e
MT
2520--
2521-- Name: jobs_packages_unique; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2522--
2523
2524ALTER TABLE ONLY jobs_packages
2525 ADD CONSTRAINT jobs_packages_unique UNIQUE (job_id, pkg_id);
2526
439d364e 2527
c660ff59
MT
2528--
2529-- Name: mirrors_checks_pkey; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2530--
2531
2532ALTER TABLE ONLY mirrors_checks
2533 ADD CONSTRAINT mirrors_checks_pkey PRIMARY KEY (id);
2534
2535
d2738057
MT
2536--
2537-- Name: sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2538--
2539
2540ALTER TABLE ONLY sessions
2541 ADD CONSTRAINT sessions_pkey PRIMARY KEY (id);
2542
2543
2544--
2545-- Name: sessions_session_id_key; Type: CONSTRAINT; Schema: public; Owner: pakfire; Tablespace:
2546--
2547
2548ALTER TABLE ONLY sessions
2549 ADD CONSTRAINT sessions_session_id_key UNIQUE (session_id);
2550
2551
439d364e 2552--
e704b8e2 2553-- Name: arches_compat_native_arch; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
439d364e
MT
2554--
2555
e704b8e2 2556CREATE INDEX arches_compat_native_arch ON arches_compat USING btree (native_arch);
439d364e
MT
2557
2558
2559--
e704b8e2 2560-- Name: builders_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
439d364e
MT
2561--
2562
e704b8e2
MT
2563CREATE UNIQUE INDEX builders_name ON builders USING btree (name) WHERE (deleted IS FALSE);
2564
2565
2566--
2567-- Name: builds_watchers_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2568--
2569
2570CREATE INDEX builds_watchers_build_id ON builds_watchers USING btree (build_id);
439d364e
MT
2571
2572
e459cbba
MT
2573--
2574-- Name: distributions_arches_distro_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2575--
2576
2577CREATE INDEX distributions_arches_distro_id ON distributions_arches USING btree (distro_id);
2578
2579
2580--
2581-- Name: distributions_sname; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2582--
2583
2584CREATE UNIQUE INDEX distributions_sname ON distributions USING btree (sname) WHERE (deleted IS FALSE);
2585
2586
64316541 2587--
e704b8e2 2588-- Name: filelists_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
64316541
MT
2589--
2590
e704b8e2 2591CREATE INDEX filelists_name ON filelists USING btree (name);
64316541
MT
2592
2593
8066bbf3
MT
2594--
2595-- Name: filelists_pkg_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2596--
2597
2598CREATE INDEX filelists_pkg_id ON filelists USING btree (pkg_id);
2599
2600ALTER TABLE filelists CLUSTER ON filelists_pkg_id;
2601
2602
64316541
MT
2603--
2604-- Name: idx_2197982_builder_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2605--
2606
2607CREATE INDEX idx_2197982_builder_id ON builders_history USING btree (builder_id);
2608
2609
2610--
2611-- Name: idx_2197988_pkg_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2612--
2613
2614CREATE INDEX idx_2197988_pkg_id ON builds USING btree (pkg_id);
2615
2616
2617--
2618-- Name: idx_2197988_state; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2619--
2620
2621CREATE INDEX idx_2197988_state ON builds USING btree (state);
2622
2623
2624--
2625-- Name: idx_2197988_type; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2626--
2627
2628CREATE INDEX idx_2197988_type ON builds USING btree (type);
2629
2630
2631--
2632-- Name: idx_2197988_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2633--
2634
2635CREATE UNIQUE INDEX idx_2197988_uuid ON builds USING btree (uuid);
2636
2637
2638--
2639-- Name: idx_2198002_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2640--
2641
2642CREATE UNIQUE INDEX idx_2198002_build_id ON builds_bugs USING btree (build_id, bug_id);
2643
2644
2645--
2646-- Name: idx_2198018_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2647--
2648
2649CREATE INDEX idx_2198018_build_id ON builds_comments USING btree (build_id);
2650
2651
2652--
2653-- Name: idx_2198018_user_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2654--
2655
2656CREATE INDEX idx_2198018_user_id ON builds_comments USING btree (user_id);
2657
2658
64316541
MT
2659--
2660-- Name: idx_2198063_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2661--
2662
2663CREATE INDEX idx_2198063_build_id ON jobs USING btree (build_id);
2664
2665
2666--
2667-- Name: idx_2198063_state; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2668--
2669
2670CREATE INDEX idx_2198063_state ON jobs USING btree (state);
2671
2672
2673--
2674-- Name: idx_2198063_time_finished; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2675--
2676
2677CREATE INDEX idx_2198063_time_finished ON jobs USING btree (time_finished);
2678
2679
64316541
MT
2680--
2681-- Name: idx_2198063_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2682--
2683
2684CREATE UNIQUE INDEX idx_2198063_uuid ON jobs USING btree (uuid);
2685
2686
64316541
MT
2687--
2688-- Name: idx_2198080_job_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2689--
2690
2691CREATE INDEX idx_2198080_job_id ON jobs_history USING btree (job_id);
2692
2693
2694--
2695-- Name: idx_2198089_job_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2696--
2697
2698CREATE UNIQUE INDEX idx_2198089_job_id ON jobs_repos USING btree (job_id, repo_id);
2699
2700
2701--
2702-- Name: idx_2198094_fingerprint; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2703--
2704
2705CREATE UNIQUE INDEX idx_2198094_fingerprint ON keys USING btree (fingerprint);
2706
2707
64316541
MT
2708--
2709-- Name: idx_2198132_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2710--
2711
2712CREATE INDEX idx_2198132_name ON packages USING btree (name);
2713
2714
64316541
MT
2715--
2716-- Name: idx_2198132_type; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2717--
2718
2719CREATE INDEX idx_2198132_type ON packages USING btree (type);
2720
2721
2722--
2723-- Name: idx_2198132_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2724--
2725
2726CREATE INDEX idx_2198132_uuid ON packages USING btree (uuid);
2727
2728
64316541
MT
2729--
2730-- Name: idx_2198139_pkg_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2731--
2732
2733CREATE INDEX idx_2198139_pkg_id ON packages_deps USING btree (pkg_id);
2734
64316541
MT
2735
2736--
2737-- Name: idx_2198147_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2738--
2739
2740CREATE UNIQUE INDEX idx_2198147_name ON packages_properties USING btree (name);
2741
2742
2743--
2744-- Name: idx_2198189_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2745--
2746
2747CREATE UNIQUE INDEX idx_2198189_build_id ON repositories_builds USING btree (build_id);
2748
2749
2750--
2751-- Name: idx_2198193_build_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2752--
2753
2754CREATE INDEX idx_2198193_build_id ON repositories_history USING btree (build_id);
2755
2756
64316541
MT
2757--
2758-- Name: idx_2198199_k; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2759--
2760
2761CREATE UNIQUE INDEX idx_2198199_k ON settings USING btree (k);
2762
2763
2764--
2765-- Name: idx_2198213_identifier; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2766--
2767
2768CREATE UNIQUE INDEX idx_2198213_identifier ON sources USING btree (identifier);
2769
2770
2771--
2772-- Name: idx_2198222_revision; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2773--
2774
2775CREATE INDEX idx_2198222_revision ON sources_commits USING btree (revision);
2776
2777
2778--
2779-- Name: idx_2198232_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2780--
2781
2782CREATE UNIQUE INDEX idx_2198232_uuid ON uploads USING btree (uuid);
2783
2784
2785--
2786-- Name: idx_2198244_name; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2787--
2788
2789CREATE UNIQUE INDEX idx_2198244_name ON users USING btree (name);
2790
2791
2792--
2793-- Name: idx_2198256_email; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2794--
2795
2796CREATE UNIQUE INDEX idx_2198256_email ON users_emails USING btree (email);
2797
2798
2799--
2800-- Name: idx_2198256_user_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2801--
2802
2803CREATE INDEX idx_2198256_user_id ON users_emails USING btree (user_id);
2804
2805
3d743a8e
MT
2806--
2807-- Name: jobs_arch; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2808--
2809
2810CREATE INDEX jobs_arch ON jobs USING btree (arch);
2811
2812
6990cac2
MT
2813--
2814-- Name: jobs_buildroots_job_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2815--
2816
2817CREATE INDEX jobs_buildroots_job_id ON jobs_buildroots USING btree (job_id);
2818
2819ALTER TABLE jobs_buildroots CLUSTER ON jobs_buildroots_job_id;
2820
2821
439d364e
MT
2822--
2823-- Name: jobs_buildroots_pkg_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2824--
2825
2826CREATE INDEX jobs_buildroots_pkg_uuid ON jobs_buildroots USING btree (pkg_uuid);
2827
2828
c660ff59
MT
2829--
2830-- Name: mirrors_checks_sort; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2831--
2832
2833CREATE INDEX mirrors_checks_sort ON mirrors_checks USING btree (mirror_id, "timestamp");
2834
2835ALTER TABLE mirrors_checks CLUSTER ON mirrors_checks_sort;
2836
2837
fe47bbac
MT
2838--
2839-- Name: repositories_builds_repo_id; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
2840--
2841
2842CREATE INDEX repositories_builds_repo_id ON repositories_builds USING btree (repo_id);
2843
2844
64316541
MT
2845--
2846-- Name: on_update_current_timestamp; Type: TRIGGER; Schema: public; Owner: pakfire
2847--
2848
2849CREATE TRIGGER on_update_current_timestamp BEFORE UPDATE ON sources FOR EACH ROW EXECUTE PROCEDURE on_update_current_timestamp_sources();
2850
2851
e704b8e2
MT
2852--
2853-- Name: arches_compat_build_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2854--
2855
2856ALTER TABLE ONLY arches_compat
2857 ADD CONSTRAINT arches_compat_build_arch FOREIGN KEY (build_arch) REFERENCES arches(name);
2858
2859
439d364e
MT
2860--
2861-- Name: builders_history_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2862--
2863
2864ALTER TABLE ONLY builders_history
2865 ADD CONSTRAINT builders_history_builder_id FOREIGN KEY (builder_id) REFERENCES builders(id);
2866
2867
2868--
2869-- Name: builders_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2870--
2871
2872ALTER TABLE ONLY builders_history
2873 ADD CONSTRAINT builders_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2874
2875
2876--
2877-- Name: builds_bug_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2878--
2879
2880ALTER TABLE ONLY builds_bugs
2881 ADD CONSTRAINT builds_bug_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2882
2883
2884--
2885-- Name: builds_comments_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2886--
2887
2888ALTER TABLE ONLY builds_comments
2889 ADD CONSTRAINT builds_comments_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2890
2891
2892--
2893-- Name: builds_comments_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2894--
2895
2896ALTER TABLE ONLY builds_comments
2897 ADD CONSTRAINT builds_comments_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2898
2899
2900--
2901-- Name: builds_depends_on; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2902--
2903
2904ALTER TABLE ONLY builds
2905 ADD CONSTRAINT builds_depends_on FOREIGN KEY (depends_on) REFERENCES builds(id);
2906
2907
2908--
2909-- Name: builds_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2910--
2911
2912ALTER TABLE ONLY builds
2913 ADD CONSTRAINT builds_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
2914
2915
2916--
2917-- Name: builds_history_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2918--
2919
2920ALTER TABLE ONLY builds_history
2921 ADD CONSTRAINT builds_history_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2922
2923
2924--
2925-- Name: builds_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2926--
2927
2928ALTER TABLE ONLY builds_history
2929 ADD CONSTRAINT builds_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2930
2931
2932--
2933-- Name: builds_owner_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2934--
2935
2936ALTER TABLE ONLY builds
2937 ADD CONSTRAINT builds_owner_id FOREIGN KEY (owner_id) REFERENCES users(id);
2938
2939
2940--
2941-- Name: builds_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2942--
2943
2944ALTER TABLE ONLY builds
2945 ADD CONSTRAINT builds_pkg_id FOREIGN KEY (pkg_id) REFERENCES packages(id);
2946
2947
2948--
2949-- Name: builds_watchers_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2950--
2951
2952ALTER TABLE ONLY builds_watchers
2953 ADD CONSTRAINT builds_watchers_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
2954
2955
2956--
2957-- Name: builds_watchers_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2958--
2959
2960ALTER TABLE ONLY builds_watchers
2961 ADD CONSTRAINT builds_watchers_user_id FOREIGN KEY (user_id) REFERENCES users(id);
2962
2963
2964--
e459cbba 2965-- Name: distributions_arches_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
439d364e
MT
2966--
2967
e459cbba
MT
2968ALTER TABLE ONLY distributions_arches
2969 ADD CONSTRAINT distributions_arches_arch FOREIGN KEY (arch) REFERENCES arches(name);
439d364e
MT
2970
2971
2972--
2973-- Name: distro_arches_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2974--
2975
e459cbba 2976ALTER TABLE ONLY distributions_arches
439d364e
MT
2977 ADD CONSTRAINT distro_arches_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
2978
2979
2980--
2981-- Name: filelists_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2982--
2983
2984ALTER TABLE ONLY filelists
2985 ADD CONSTRAINT filelists_pkg_id FOREIGN KEY (pkg_id) REFERENCES packages(id);
2986
2987
2988--
3d743a8e 2989-- Name: jobs_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
439d364e
MT
2990--
2991
2992ALTER TABLE ONLY jobs
3d743a8e 2993 ADD CONSTRAINT jobs_arch FOREIGN KEY (arch) REFERENCES arches(name);
439d364e
MT
2994
2995
2996--
2997-- Name: jobs_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
2998--
2999
3000ALTER TABLE ONLY jobs
3001 ADD CONSTRAINT jobs_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
3002
3003
3004--
3005-- Name: jobs_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3006--
3007
3008ALTER TABLE ONLY jobs
3009 ADD CONSTRAINT jobs_builder_id FOREIGN KEY (builder_id) REFERENCES builders(id);
3010
3011
3012--
3013-- Name: jobs_buildroots_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3014--
3015
3016ALTER TABLE ONLY jobs_buildroots
3017 ADD CONSTRAINT jobs_buildroots_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
3018
3019
3020--
3021-- Name: jobs_history_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3022--
3023
3024ALTER TABLE ONLY jobs_history
3025 ADD CONSTRAINT jobs_history_builder_id FOREIGN KEY (builder_id) REFERENCES builders(id);
3026
3027
3028--
3029-- Name: jobs_history_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3030--
3031
3032ALTER TABLE ONLY jobs_history
3033 ADD CONSTRAINT jobs_history_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
3034
3035
3036--
3037-- Name: jobs_history_test_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3038--
3039
3040ALTER TABLE ONLY jobs_history
3041 ADD CONSTRAINT jobs_history_test_job_id FOREIGN KEY (test_job_id) REFERENCES jobs(id);
3042
3043
3044--
3045-- Name: jobs_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3046--
3047
3048ALTER TABLE ONLY jobs_history
3049 ADD CONSTRAINT jobs_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
3050
3051
3052--
3053-- Name: jobs_packaged_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3054--
3055
3056ALTER TABLE ONLY jobs_packages
3057 ADD CONSTRAINT jobs_packaged_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
3058
3059
3060--
3061-- Name: jobs_packages_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3062--
3063
3064ALTER TABLE ONLY jobs_packages
3065 ADD CONSTRAINT jobs_packages_pkg_id FOREIGN KEY (pkg_id) REFERENCES packages(id);
3066
3067
3068--
3069-- Name: jobs_repos_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3070--
3071
3072ALTER TABLE ONLY jobs_repos
3073 ADD CONSTRAINT jobs_repos_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
3074
3075
3076--
3077-- Name: jobs_repos_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3078--
3079
3080ALTER TABLE ONLY jobs_repos
3081 ADD CONSTRAINT jobs_repos_repo_id FOREIGN KEY (repo_id) REFERENCES repositories(id);
3082
3083
3084--
3085-- Name: keys_subkeys_key_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3086--
3087
3088ALTER TABLE ONLY keys_subkeys
3089 ADD CONSTRAINT keys_subkeys_key_id FOREIGN KEY (key_id) REFERENCES keys(id);
3090
3091
3092--
3093-- Name: logfiles_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3094--
3095
3096ALTER TABLE ONLY logfiles
3097 ADD CONSTRAINT logfiles_job_id FOREIGN KEY (job_id) REFERENCES jobs(id);
3098
3099
c660ff59
MT
3100--
3101-- Name: mirrors_checks_mirror_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3102--
3103
3104ALTER TABLE ONLY mirrors_checks
3105 ADD CONSTRAINT mirrors_checks_mirror_id FOREIGN KEY (mirror_id) REFERENCES mirrors(id);
3106
3107
439d364e
MT
3108--
3109-- Name: mirrors_history_mirror_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3110--
3111
3112ALTER TABLE ONLY mirrors_history
3113 ADD CONSTRAINT mirrors_history_mirror_id FOREIGN KEY (mirror_id) REFERENCES mirrors(id);
3114
3115
3116--
3117-- Name: mirrors_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3118--
3119
3120ALTER TABLE ONLY mirrors_history
3121 ADD CONSTRAINT mirrors_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
3122
3123
f835411e
MT
3124--
3125-- Name: packages_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3126--
3127
3128ALTER TABLE ONLY packages
22b715d7 3129 ADD CONSTRAINT packages_arch FOREIGN KEY (arch) REFERENCES arches(name);
f835411e
MT
3130
3131
3132--
3133-- Name: packages_commit_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3134--
3135
3136ALTER TABLE ONLY packages
3137 ADD CONSTRAINT packages_commit_id FOREIGN KEY (commit_id) REFERENCES sources_commits(id);
3138
3139
439d364e
MT
3140--
3141-- Name: packages_deps_pkg_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3142--
3143
3144ALTER TABLE ONLY packages_deps
3145 ADD CONSTRAINT packages_deps_pkg_id FOREIGN KEY (pkg_id) REFERENCES packages(id);
3146
3147
3148--
3149-- Name: repositories_aux_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3150--
3151
3152ALTER TABLE ONLY repositories_aux
3153 ADD CONSTRAINT repositories_aux_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
3154
3155
3156--
3157-- Name: repositories_builds_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3158--
3159
3160ALTER TABLE ONLY repositories_builds
3161 ADD CONSTRAINT repositories_builds_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
3162
3163
3164--
3165-- Name: repositories_builds_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3166--
3167
3168ALTER TABLE ONLY repositories_builds
3169 ADD CONSTRAINT repositories_builds_repo_id FOREIGN KEY (repo_id) REFERENCES repositories(id);
3170
3171
3172--
3173-- Name: repositories_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3174--
3175
3176ALTER TABLE ONLY repositories
3177 ADD CONSTRAINT repositories_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
3178
3179
3180--
3181-- Name: repositories_history_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3182--
3183
3184ALTER TABLE ONLY repositories_history
3185 ADD CONSTRAINT repositories_history_build_id FOREIGN KEY (build_id) REFERENCES builds(id);
3186
3187
3188--
3189-- Name: repositories_history_from_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3190--
3191
3192ALTER TABLE ONLY repositories_history
3193 ADD CONSTRAINT repositories_history_from_repo_id FOREIGN KEY (from_repo_id) REFERENCES repositories(id);
3194
3195
3196--
3197-- Name: repositories_history_to_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3198--
3199
3200ALTER TABLE ONLY repositories_history
3201 ADD CONSTRAINT repositories_history_to_repo_id FOREIGN KEY (to_repo_id) REFERENCES repositories(id);
3202
3203
3204--
3205-- Name: repositories_history_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3206--
3207
3208ALTER TABLE ONLY repositories_history
3209 ADD CONSTRAINT repositories_history_user_id FOREIGN KEY (user_id) REFERENCES users(id);
3210
3211
3212--
3213-- Name: repositories_key_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3214--
3215
3216ALTER TABLE ONLY repositories
3217 ADD CONSTRAINT repositories_key_id FOREIGN KEY (key_id) REFERENCES keys(id);
3218
3219
3220--
3221-- Name: repositories_parent_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3222--
3223
3224ALTER TABLE ONLY repositories
3225 ADD CONSTRAINT repositories_parent_id FOREIGN KEY (parent_id) REFERENCES repositories(id);
3226
3227
a7a18be1
MT
3228--
3229-- Name: repositories_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3230--
3231
3232ALTER TABLE ONLY repositories
3233 ADD CONSTRAINT repositories_user_id FOREIGN KEY (user_id) REFERENCES users(id);
3234
3235
439d364e
MT
3236--
3237-- Name: sessions_impersonated_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3238--
3239
3240ALTER TABLE ONLY sessions
3241 ADD CONSTRAINT sessions_impersonated_user_id FOREIGN KEY (impersonated_user_id) REFERENCES users(id);
3242
3243
3244--
3245-- Name: sessions_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3246--
3247
3248ALTER TABLE ONLY sessions
3249 ADD CONSTRAINT sessions_user_id FOREIGN KEY (user_id) REFERENCES users(id);
3250
3251
3252--
3253-- Name: sources_commits_source_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3254--
3255
3256ALTER TABLE ONLY sources_commits
3257 ADD CONSTRAINT sources_commits_source_id FOREIGN KEY (source_id) REFERENCES sources(id);
3258
3259
3260--
3261-- Name: sources_distro_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3262--
3263
3264ALTER TABLE ONLY sources
3265 ADD CONSTRAINT sources_distro_id FOREIGN KEY (distro_id) REFERENCES distributions(id);
3266
3267
3268--
3269-- Name: uploads_builder_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3270--
3271
3272ALTER TABLE ONLY uploads
3273 ADD CONSTRAINT uploads_builder_id FOREIGN KEY (builder_id) REFERENCES builders(id);
3274
3275
3276--
3277-- Name: uploads_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3278--
3279
3280ALTER TABLE ONLY uploads
3281 ADD CONSTRAINT uploads_user_id FOREIGN KEY (user_id) REFERENCES users(id);
3282
3283
3284--
3285-- Name: users_emails_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3286--
3287
3288ALTER TABLE ONLY users_emails
3289 ADD CONSTRAINT users_emails_user_id FOREIGN KEY (user_id) REFERENCES users(id);
3290
3291
3292--
3293-- Name: users_permissions_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
3294--
3295
3296ALTER TABLE ONLY users_permissions
3297 ADD CONSTRAINT users_permissions_user_id FOREIGN KEY (user_id) REFERENCES users(id);
3298
3299
64316541
MT
3300--
3301-- PostgreSQL database dump complete
3302--
9050c160 3303