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