aboutsummaryrefslogtreecommitdiff
blob: 39a2b931aefa7d7ba8ee0d399e093e37959c13b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
--
-- PostgreSQL database dump
--

SET client_encoding = 'UTF8';
SET check_function_bodies = false;
SET client_min_messages = warning;

--
-- Name: collagen; Type: DATABASE; Schema: -; Owner: w0rm
--

CREATE DATABASE collagen WITH TEMPLATE = template0 ENCODING = 'UTF8';


\connect collagen

SET client_encoding = 'UTF8';
SET check_function_bodies = false;
SET client_min_messages = warning;

--
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--

COMMENT ON SCHEMA public IS 'Standard public schema';


SET search_path = public, pg_catalog;

--
-- Name: attachment_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE attachment_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


SET default_tablespace = '';

SET default_with_oids = false;

--
-- Name: attachment; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE attachment (
    id integer DEFAULT nextval('attachment_id_seq'::regclass) NOT NULL,
    packageproperties_id integer NOT NULL,
    name character varying(255) NOT NULL,
    content text,
    mimetype character varying(255) DEFAULT 'text/plain'::character varying NOT NULL
);


SET default_with_oids = true;

--
-- Name: custom_fields_lists; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE custom_fields_lists (
    field_id integer,
    list_option_id integer,
    list_value character varying(250)
);


--
-- Name: file_id_seq; Type: SEQUENCE; Schema: public; Owner: w0rm
--

CREATE SEQUENCE file_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


SET default_with_oids = false;

--
-- Name: file; Type: TABLE; Schema: public; Owner: w0rm; Tablespace: 
--

CREATE TABLE file (
    path text NOT NULL,
    id integer DEFAULT nextval('file_id_seq'::regclass) NOT NULL
);


--
-- Name: filetype_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE filetype_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


--
-- Name: filetype; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE filetype (
    id integer DEFAULT nextval('filetype_id_seq'::regclass) NOT NULL,
    name character varying(20) NOT NULL
);


--
-- Name: package_id_seq; Type: SEQUENCE; Schema: public; Owner: w0rm
--

CREATE SEQUENCE package_id_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


--
-- Name: package; Type: TABLE; Schema: public; Owner: w0rm; Tablespace: 
--

CREATE TABLE package (
    id integer DEFAULT nextval('package_id_seq'::regclass) NOT NULL,
    name character varying(255) NOT NULL
);


--
-- Name: packagecategory_id_seq; Type: SEQUENCE; Schema: public; Owner: w0rm
--

CREATE SEQUENCE packagecategory_id_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


--
-- Name: packagecategory; Type: TABLE; Schema: public; Owner: w0rm; Tablespace: 
--

CREATE TABLE packagecategory (
    id integer DEFAULT nextval('packagecategory_id_seq'::regclass) NOT NULL,
    name character varying(255) NOT NULL
);


--
-- Name: packageproperties_seq_id; Type: SEQUENCE; Schema: public; Owner: w0rm
--

CREATE SEQUENCE packageproperties_seq_id
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


--
-- Name: packageproperties; Type: TABLE; Schema: public; Owner: w0rm; Tablespace: 
--

CREATE TABLE packageproperties (
    id integer DEFAULT nextval('packageproperties_seq_id'::regclass) NOT NULL,
    packageversion_id integer NOT NULL,
    profile_id integer NOT NULL
);


--
-- Name: packageproperties_file; Type: TABLE; Schema: public; Owner: w0rm; Tablespace: 
--

CREATE TABLE packageproperties_file (
    packageproperties_id integer NOT NULL,
    file_id integer NOT NULL,
    hash character(32),
    size integer,
    type_id integer NOT NULL
);


--
-- Name: packageproperties_useflag; Type: TABLE; Schema: public; Owner: w0rm; Tablespace: 
--

CREATE TABLE packageproperties_useflag (
    packageproperties_id integer NOT NULL,
    useflag_id integer NOT NULL
);


--
-- Name: packageversion_id_seq; Type: SEQUENCE; Schema: public; Owner: w0rm
--

CREATE SEQUENCE packageversion_id_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


--
-- Name: packageversion; Type: TABLE; Schema: public; Owner: w0rm; Tablespace: 
--

CREATE TABLE packageversion (
    id integer DEFAULT nextval('packageversion_id_seq'::regclass) NOT NULL,
    category_id integer NOT NULL,
    package_id integer NOT NULL,
    version character varying(255) NOT NULL
);


--
-- Name: packageversion_packageversion; Type: TABLE; Schema: public; Owner: w0rm; Tablespace: 
--

CREATE TABLE packageversion_packageversion (
    packageversion_id integer NOT NULL,
    dependency_id integer NOT NULL
);


--
-- Name: portageprofile_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE portageprofile_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


--
-- Name: portageprofile; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE portageprofile (
    id integer DEFAULT nextval('portageprofile_id_seq'::regclass) NOT NULL,
    name character varying(255) NOT NULL
);


--
-- Name: useflag; Type: TABLE; Schema: public; Owner: w0rm; Tablespace: 
--

CREATE TABLE useflag (
    id integer NOT NULL,
    name character varying(255) NOT NULL
);


--
-- Name: PK_attachment; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY attachment
    ADD CONSTRAINT "PK_attachment" PRIMARY KEY (id);


--
-- Name: PK_file; Type: CONSTRAINT; Schema: public; Owner: w0rm; Tablespace: 
--

ALTER TABLE ONLY file
    ADD CONSTRAINT "PK_file" PRIMARY KEY (id);


--
-- Name: PK_filetype; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY filetype
    ADD CONSTRAINT "PK_filetype" PRIMARY KEY (id);


--
-- Name: PK_packageproperties; Type: CONSTRAINT; Schema: public; Owner: w0rm; Tablespace: 
--

ALTER TABLE ONLY packageproperties_file
    ADD CONSTRAINT "PK_packageproperties" PRIMARY KEY (packageproperties_id, file_id, type_id);


--
-- Name: PK_packageproperties_useflag; Type: CONSTRAINT; Schema: public; Owner: w0rm; Tablespace: 
--

ALTER TABLE ONLY packageproperties_useflag
    ADD CONSTRAINT "PK_packageproperties_useflag" PRIMARY KEY (packageproperties_id, useflag_id);


--
-- Name: PK_packageversion_packageversion; Type: CONSTRAINT; Schema: public; Owner: w0rm; Tablespace: 
--

ALTER TABLE ONLY packageversion_packageversion
    ADD CONSTRAINT "PK_packageversion_packageversion" PRIMARY KEY (packageversion_id, dependency_id);


--
-- Name: PK_portageprofile; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY portageprofile
    ADD CONSTRAINT "PK_portageprofile" PRIMARY KEY (id);


--
-- Name: pk_package; Type: CONSTRAINT; Schema: public; Owner: w0rm; Tablespace: 
--

ALTER TABLE ONLY package
    ADD CONSTRAINT pk_package PRIMARY KEY (id);


--
-- Name: pk_packagecategory; Type: CONSTRAINT; Schema: public; Owner: w0rm; Tablespace: 
--

ALTER TABLE ONLY packagecategory
    ADD CONSTRAINT pk_packagecategory PRIMARY KEY (id);


--
-- Name: pk_packageproperties; Type: CONSTRAINT; Schema: public; Owner: w0rm; Tablespace: 
--

ALTER TABLE ONLY packageproperties
    ADD CONSTRAINT pk_packageproperties PRIMARY KEY (id);


--
-- Name: pk_packageversion; Type: CONSTRAINT; Schema: public; Owner: w0rm; Tablespace: 
--

ALTER TABLE ONLY packageversion
    ADD CONSTRAINT pk_packageversion PRIMARY KEY (id);


--
-- Name: pk_useflag; Type: CONSTRAINT; Schema: public; Owner: w0rm; Tablespace: 
--

ALTER TABLE ONLY useflag
    ADD CONSTRAINT pk_useflag PRIMARY KEY (id);


--
-- Name: FK_attachment_packageproperties; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY attachment
    ADD CONSTRAINT "FK_attachment_packageproperties" FOREIGN KEY (packageproperties_id) REFERENCES packageproperties(id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: FK_packageproperties_file_f_id; Type: FK CONSTRAINT; Schema: public; Owner: w0rm
--

ALTER TABLE ONLY packageproperties_file
    ADD CONSTRAINT "FK_packageproperties_file_f_id" FOREIGN KEY (file_id) REFERENCES file(id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: FK_packageproperties_file_filetype_id; Type: FK CONSTRAINT; Schema: public; Owner: w0rm
--

ALTER TABLE ONLY packageproperties_file
    ADD CONSTRAINT "FK_packageproperties_file_filetype_id" FOREIGN KEY (packageproperties_id) REFERENCES filetype(id);


--
-- Name: FK_packageproperties_file_pp_id; Type: FK CONSTRAINT; Schema: public; Owner: w0rm
--

ALTER TABLE ONLY packageproperties_file
    ADD CONSTRAINT "FK_packageproperties_file_pp_id" FOREIGN KEY (packageproperties_id) REFERENCES packageproperties(id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: FK_packageproperties_packagerversion_id; Type: FK CONSTRAINT; Schema: public; Owner: w0rm
--

ALTER TABLE ONLY packageproperties
    ADD CONSTRAINT "FK_packageproperties_packagerversion_id" FOREIGN KEY (packageversion_id) REFERENCES packageversion(id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: FK_packageproperties_profile; Type: FK CONSTRAINT; Schema: public; Owner: w0rm
--

ALTER TABLE ONLY packageproperties
    ADD CONSTRAINT "FK_packageproperties_profile" FOREIGN KEY (profile_id) REFERENCES portageprofile(id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: FK_packageproperties_useflag_pp_id; Type: FK CONSTRAINT; Schema: public; Owner: w0rm
--

ALTER TABLE ONLY packageproperties_useflag
    ADD CONSTRAINT "FK_packageproperties_useflag_pp_id" FOREIGN KEY (packageproperties_id) REFERENCES packageproperties(id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: FK_packageproperties_useflag_u_id; Type: FK CONSTRAINT; Schema: public; Owner: w0rm
--

ALTER TABLE ONLY packageproperties_useflag
    ADD CONSTRAINT "FK_packageproperties_useflag_u_id" FOREIGN KEY (useflag_id) REFERENCES useflag(id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: FK_packageversion_dependency_id; Type: FK CONSTRAINT; Schema: public; Owner: w0rm
--

ALTER TABLE ONLY packageversion_packageversion
    ADD CONSTRAINT "FK_packageversion_dependency_id" FOREIGN KEY (dependency_id) REFERENCES packageversion(id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: FK_packageversion_package; Type: FK CONSTRAINT; Schema: public; Owner: w0rm
--

ALTER TABLE ONLY packageversion
    ADD CONSTRAINT "FK_packageversion_package" FOREIGN KEY (package_id) REFERENCES package(id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: FK_packageversion_packagecategory_id; Type: FK CONSTRAINT; Schema: public; Owner: w0rm
--

ALTER TABLE ONLY packageversion
    ADD CONSTRAINT "FK_packageversion_packagecategory_id" FOREIGN KEY (category_id) REFERENCES packagecategory(id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: FK_packageversion_packageversion_id; Type: FK CONSTRAINT; Schema: public; Owner: w0rm
--

ALTER TABLE ONLY packageversion_packageversion
    ADD CONSTRAINT "FK_packageversion_packageversion_id" FOREIGN KEY (packageversion_id) REFERENCES packageversion(id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- PostgreSQL database dump complete
--