1 | ----------------------------------------------------------------------------- |
---|
2 | -- piwigo_caddie |
---|
3 | ----------------------------------------------------------------------------- |
---|
4 | |
---|
5 | DROP TABLE IF EXISTS piwigo_caddie; |
---|
6 | CREATE TABLE "piwigo_caddie" |
---|
7 | ( |
---|
8 | "user_id" INTEGER default 0 NOT NULL, |
---|
9 | "element_id" INTEGER default 0 NOT NULL, |
---|
10 | PRIMARY KEY ("user_id","element_id") |
---|
11 | ); |
---|
12 | |
---|
13 | COMMENT ON TABLE "piwigo_caddie" IS ''; |
---|
14 | |
---|
15 | |
---|
16 | SET search_path TO public; |
---|
17 | ----------------------------------------------------------------------------- |
---|
18 | -- piwigo_categories |
---|
19 | ----------------------------------------------------------------------------- |
---|
20 | |
---|
21 | DROP TYPE IF EXISTS CATEGORIES_STATUS; |
---|
22 | CREATE TYPE CATEGORIES_STATUS AS ENUM('public', 'private'); |
---|
23 | |
---|
24 | DROP TABLE IF EXISTS "piwigo_categories" CASCADE; |
---|
25 | CREATE TABLE "piwigo_categories" |
---|
26 | ( |
---|
27 | "id" serial NOT NULL, |
---|
28 | "name" VARCHAR(255) default '' NOT NULL, |
---|
29 | "id_uppercat" INTEGER, |
---|
30 | "comment" TEXT, |
---|
31 | "dir" VARCHAR(255), |
---|
32 | "rank" INTEGER, |
---|
33 | "status" CATEGORIES_STATUS default 'public'::CATEGORIES_STATUS, |
---|
34 | "site_id" INTEGER default 1, |
---|
35 | "visible" BOOLEAN default true, |
---|
36 | "representative_picture_id" INTEGER, |
---|
37 | "uppercats" TEXT, |
---|
38 | "commentable" BOOLEAN default true, |
---|
39 | "global_rank" VARCHAR(255), |
---|
40 | "image_order" VARCHAR(128), |
---|
41 | "permalink" VARCHAR(64), |
---|
42 | PRIMARY KEY ("id"), |
---|
43 | CONSTRAINT "categories_i3" UNIQUE ("permalink") |
---|
44 | ); |
---|
45 | |
---|
46 | COMMENT ON TABLE "piwigo_categories" IS ''; |
---|
47 | |
---|
48 | |
---|
49 | SET search_path TO public; |
---|
50 | CREATE INDEX "categories_i2" ON "piwigo_categories" ("id_uppercat"); |
---|
51 | |
---|
52 | ----------------------------------------------------------------------------- |
---|
53 | -- piwigo_config |
---|
54 | ----------------------------------------------------------------------------- |
---|
55 | |
---|
56 | DROP TABLE IF EXISTS "piwigo_config" CASCADE; |
---|
57 | CREATE TABLE "piwigo_config" |
---|
58 | ( |
---|
59 | "param" VARCHAR(40) default '' NOT NULL, |
---|
60 | "value" TEXT, |
---|
61 | "comment" VARCHAR(255), |
---|
62 | PRIMARY KEY ("param") |
---|
63 | ); |
---|
64 | |
---|
65 | COMMENT ON TABLE "piwigo_config" IS ''; |
---|
66 | |
---|
67 | |
---|
68 | SET search_path TO public; |
---|
69 | ----------------------------------------------------------------------------- |
---|
70 | -- piwigo_favorites |
---|
71 | ----------------------------------------------------------------------------- |
---|
72 | |
---|
73 | DROP TABLE IF EXISTS "piwigo_favorites" CASCADE; |
---|
74 | CREATE TABLE "piwigo_favorites" |
---|
75 | ( |
---|
76 | "user_id" INTEGER default 0 NOT NULL, |
---|
77 | "image_id" INTEGER default 0 NOT NULL, |
---|
78 | PRIMARY KEY ("user_id","image_id") |
---|
79 | ); |
---|
80 | |
---|
81 | COMMENT ON TABLE "piwigo_favorites" IS ''; |
---|
82 | |
---|
83 | |
---|
84 | SET search_path TO public; |
---|
85 | ----------------------------------------------------------------------------- |
---|
86 | -- piwigo_group_access |
---|
87 | ----------------------------------------------------------------------------- |
---|
88 | |
---|
89 | DROP TABLE IF EXISTS "piwigo_group_access" CASCADE; |
---|
90 | CREATE TABLE "piwigo_group_access" |
---|
91 | ( |
---|
92 | "group_id" INTEGER default 0 NOT NULL, |
---|
93 | "cat_id" INTEGER default 0 NOT NULL, |
---|
94 | PRIMARY KEY ("group_id","cat_id") |
---|
95 | ); |
---|
96 | |
---|
97 | COMMENT ON TABLE "piwigo_group_access" IS ''; |
---|
98 | |
---|
99 | |
---|
100 | SET search_path TO public; |
---|
101 | ----------------------------------------------------------------------------- |
---|
102 | -- piwigo_groups |
---|
103 | ----------------------------------------------------------------------------- |
---|
104 | |
---|
105 | DROP TABLE IF EXISTS "piwigo_groups" CASCADE; |
---|
106 | CREATE TABLE "piwigo_groups" |
---|
107 | ( |
---|
108 | "id" serial NOT NULL, |
---|
109 | "name" VARCHAR(255) default '' NOT NULL, |
---|
110 | "is_default" BOOLEAN default false, |
---|
111 | PRIMARY KEY ("id"), |
---|
112 | CONSTRAINT "groups_ui1" UNIQUE ("name") |
---|
113 | ); |
---|
114 | |
---|
115 | COMMENT ON TABLE "piwigo_groups" IS ''; |
---|
116 | |
---|
117 | |
---|
118 | SET search_path TO public; |
---|
119 | ----------------------------------------------------------------------------- |
---|
120 | -- piwigo_history |
---|
121 | ----------------------------------------------------------------------------- |
---|
122 | |
---|
123 | DROP TYPE IF EXISTS HISTORY_SECTION; |
---|
124 | CREATE TYPE HISTORY_SECTION AS ENUM('categories','tags','search','list','favorites','most_visited','best_rated','recent_pics','recent_cats'); |
---|
125 | DROP TYPE IF EXISTS HISTORY_IMAGE_TYPE; |
---|
126 | CREATE TYPE HISTORY_IMAGE_TYPE AS ENUM('picture','high','other'); |
---|
127 | |
---|
128 | DROP TABLE IF EXISTS "piwigo_history" CASCADE; |
---|
129 | CREATE TABLE "piwigo_history" |
---|
130 | ( |
---|
131 | "id" serial NOT NULL, |
---|
132 | "date" DATE NOT NULL, |
---|
133 | "time" TIME NOT NULL, |
---|
134 | "user_id" INTEGER default 0 NOT NULL, |
---|
135 | "ip" VARCHAR(15) default '' NOT NULL, |
---|
136 | "section" HISTORY_SECTION default NULL, |
---|
137 | "category_id" INTEGER, |
---|
138 | "tag_ids" VARCHAR(50), |
---|
139 | "image_id" INTEGER, |
---|
140 | "summarized" BOOLEAN default false, |
---|
141 | "image_type" HISTORY_IMAGE_TYPE default NULL, |
---|
142 | PRIMARY KEY ("id") |
---|
143 | ); |
---|
144 | |
---|
145 | COMMENT ON TABLE "piwigo_history" IS ''; |
---|
146 | |
---|
147 | |
---|
148 | SET search_path TO public; |
---|
149 | CREATE INDEX "history_i1" ON "piwigo_history" ("summarized"); |
---|
150 | |
---|
151 | ----------------------------------------------------------------------------- |
---|
152 | -- piwigo_history_summary |
---|
153 | ----------------------------------------------------------------------------- |
---|
154 | |
---|
155 | DROP TABLE IF EXISTS "piwigo_history_summary" CASCADE; |
---|
156 | CREATE TABLE "piwigo_history_summary" |
---|
157 | ( |
---|
158 | "year" INTEGER default 0 NOT NULL, |
---|
159 | "month" INTEGER, |
---|
160 | "day" INTEGER, |
---|
161 | "hour" INTEGER, |
---|
162 | "nb_pages" INTEGER, |
---|
163 | "id" serial NOT NULL, |
---|
164 | PRIMARY KEY ("id"), |
---|
165 | CONSTRAINT "history_summary_ymdh" UNIQUE ("year","month","day","hour") |
---|
166 | ); |
---|
167 | |
---|
168 | COMMENT ON TABLE "piwigo_history_summary" IS ''; |
---|
169 | |
---|
170 | |
---|
171 | SET search_path TO public; |
---|
172 | ----------------------------------------------------------------------------- |
---|
173 | -- piwigo_image_category |
---|
174 | ----------------------------------------------------------------------------- |
---|
175 | |
---|
176 | DROP TABLE IF EXISTS "piwigo_image_category" CASCADE; |
---|
177 | CREATE TABLE "piwigo_image_category" |
---|
178 | ( |
---|
179 | "image_id" INTEGER default 0 NOT NULL, |
---|
180 | "category_id" INTEGER default 0 NOT NULL, |
---|
181 | "rank" INTEGER, |
---|
182 | PRIMARY KEY ("image_id","category_id") |
---|
183 | ); |
---|
184 | |
---|
185 | COMMENT ON TABLE "piwigo_image_category" IS ''; |
---|
186 | |
---|
187 | |
---|
188 | SET search_path TO public; |
---|
189 | CREATE INDEX "image_category_i1" ON "piwigo_image_category" ("category_id"); |
---|
190 | |
---|
191 | ----------------------------------------------------------------------------- |
---|
192 | -- piwigo_image_tag |
---|
193 | ----------------------------------------------------------------------------- |
---|
194 | |
---|
195 | DROP TABLE IF EXISTS "piwigo_image_tag" CASCADE; |
---|
196 | CREATE TABLE "piwigo_image_tag" |
---|
197 | ( |
---|
198 | "image_id" INTEGER default 0 NOT NULL, |
---|
199 | "tag_id" INTEGER default 0 NOT NULL, |
---|
200 | PRIMARY KEY ("image_id","tag_id") |
---|
201 | ); |
---|
202 | |
---|
203 | COMMENT ON TABLE "piwigo_image_tag" IS ''; |
---|
204 | |
---|
205 | |
---|
206 | SET search_path TO public; |
---|
207 | CREATE INDEX "image_tag_i1" ON "piwigo_image_tag" ("tag_id"); |
---|
208 | |
---|
209 | ----------------------------------------------------------------------------- |
---|
210 | -- piwigo_images |
---|
211 | ----------------------------------------------------------------------------- |
---|
212 | |
---|
213 | DROP TABLE IF EXISTS "piwigo_images" CASCADE; |
---|
214 | CREATE TABLE "piwigo_images" |
---|
215 | ( |
---|
216 | "id" serial NOT NULL, |
---|
217 | "file" VARCHAR(255) default '' NOT NULL, |
---|
218 | "date_available" TIMESTAMP NOT NULL, |
---|
219 | "date_creation" TIMESTAMP, |
---|
220 | "tn_ext" VARCHAR(4) default '', |
---|
221 | "name" VARCHAR(255), |
---|
222 | "comment" TEXT, |
---|
223 | "author" VARCHAR(255), |
---|
224 | "hit" INTEGER default 0 NOT NULL, |
---|
225 | "filesize" INTEGER, |
---|
226 | "width" INTEGER, |
---|
227 | "height" INTEGER, |
---|
228 | "representative_ext" VARCHAR(4), |
---|
229 | "date_metadata_update" DATE, |
---|
230 | "rating_score" FLOAT, |
---|
231 | "has_high" BOOLEAN default false, |
---|
232 | "path" VARCHAR(255) default '' NOT NULL, |
---|
233 | "storage_category_id" INTEGER, |
---|
234 | "high_filesize" INTEGER, |
---|
235 | "high_width" INTEGER, |
---|
236 | "high_height" INTEGER, |
---|
237 | "level" INTEGER default 0 NOT NULL, |
---|
238 | "md5sum" CHAR(32), |
---|
239 | "added_by" INTEGER default 0 NOT NULL, |
---|
240 | PRIMARY KEY ("id") |
---|
241 | ); |
---|
242 | |
---|
243 | COMMENT ON TABLE "piwigo_images" IS ''; |
---|
244 | |
---|
245 | |
---|
246 | SET search_path TO public; |
---|
247 | CREATE INDEX "images_i2" ON "piwigo_images" ("date_available"); |
---|
248 | |
---|
249 | CREATE INDEX "images_i3" ON "piwigo_images" ("rating_score"); |
---|
250 | |
---|
251 | CREATE INDEX "images_i4" ON "piwigo_images" ("hit"); |
---|
252 | |
---|
253 | CREATE INDEX "images_i5" ON "piwigo_images" ("date_creation"); |
---|
254 | |
---|
255 | CREATE INDEX "images_i1" ON "piwigo_images" ("storage_category_id"); |
---|
256 | |
---|
257 | ----------------------------------------------------------------------------- |
---|
258 | -- Table structure for table `piwigo_languages` |
---|
259 | ----------------------------------------------------------------------------- |
---|
260 | |
---|
261 | DROP TABLE IF EXISTS "piwigo_languages"; |
---|
262 | CREATE TABLE "piwigo_languages" ( |
---|
263 | "id" varchar(64) NOT NULL default '', |
---|
264 | "version" varchar(64) NOT NULL default '0', |
---|
265 | "name" varchar(64) default NULL, |
---|
266 | PRIMARY KEY ("id") |
---|
267 | ); |
---|
268 | |
---|
269 | COMMENT ON TABLE "piwigo_languages" IS ''; |
---|
270 | |
---|
271 | ----------------------------------------------------------------------------- |
---|
272 | -- piwigo_old_permalinks |
---|
273 | ----------------------------------------------------------------------------- |
---|
274 | |
---|
275 | DROP TABLE IF EXISTS "piwigo_old_permalinks" CASCADE; |
---|
276 | CREATE TABLE "piwigo_old_permalinks" |
---|
277 | ( |
---|
278 | "cat_id" INTEGER default 0 NOT NULL, |
---|
279 | "permalink" VARCHAR(64) default '' NOT NULL, |
---|
280 | "date_deleted" TIMESTAMP NOT NULL, |
---|
281 | "last_hit" TIMESTAMP, |
---|
282 | "hit" INTEGER default 0 NOT NULL, |
---|
283 | PRIMARY KEY ("permalink") |
---|
284 | ); |
---|
285 | |
---|
286 | COMMENT ON TABLE "piwigo_old_permalinks" IS ''; |
---|
287 | |
---|
288 | |
---|
289 | SET search_path TO public; |
---|
290 | ----------------------------------------------------------------------------- |
---|
291 | -- piwigo_plugins |
---|
292 | ----------------------------------------------------------------------------- |
---|
293 | |
---|
294 | DROP TYPE IF EXISTS PLUGINS_STATE; |
---|
295 | CREATE TYPE PLUGINS_STATE AS ENUM('active', 'inactive'); |
---|
296 | |
---|
297 | DROP TABLE IF EXISTS "piwigo_plugins" CASCADE; |
---|
298 | CREATE TABLE "piwigo_plugins" |
---|
299 | ( |
---|
300 | "id" VARCHAR(64) default '' NOT NULL, |
---|
301 | "state" PLUGINS_STATE default 'inactive'::PLUGINS_STATE, |
---|
302 | "version" VARCHAR(64) default '0' NOT NULL, |
---|
303 | PRIMARY KEY ("id") |
---|
304 | ); |
---|
305 | |
---|
306 | COMMENT ON TABLE "piwigo_plugins" IS ''; |
---|
307 | |
---|
308 | |
---|
309 | SET search_path TO public; |
---|
310 | ----------------------------------------------------------------------------- |
---|
311 | -- piwigo_rate |
---|
312 | ----------------------------------------------------------------------------- |
---|
313 | |
---|
314 | DROP TABLE IF EXISTS "piwigo_rate" CASCADE; |
---|
315 | CREATE TABLE "piwigo_rate" |
---|
316 | ( |
---|
317 | "user_id" INTEGER default 0 NOT NULL, |
---|
318 | "element_id" INTEGER default 0 NOT NULL, |
---|
319 | "anonymous_id" VARCHAR(45) default '' NOT NULL, |
---|
320 | "rate" INTEGER default 0 NOT NULL, |
---|
321 | "date" DATE NOT NULL, |
---|
322 | PRIMARY KEY ("user_id","element_id","anonymous_id") |
---|
323 | ); |
---|
324 | |
---|
325 | COMMENT ON TABLE "piwigo_rate" IS ''; |
---|
326 | |
---|
327 | |
---|
328 | SET search_path TO public; |
---|
329 | ----------------------------------------------------------------------------- |
---|
330 | -- piwigo_search |
---|
331 | ----------------------------------------------------------------------------- |
---|
332 | |
---|
333 | DROP TABLE IF EXISTS "piwigo_search" CASCADE; |
---|
334 | CREATE TABLE "piwigo_search" |
---|
335 | ( |
---|
336 | "id" serial NOT NULL, |
---|
337 | "last_seen" DATE, |
---|
338 | "rules" TEXT, |
---|
339 | PRIMARY KEY ("id") |
---|
340 | ); |
---|
341 | |
---|
342 | COMMENT ON TABLE "piwigo_search" IS ''; |
---|
343 | |
---|
344 | |
---|
345 | SET search_path TO public; |
---|
346 | ----------------------------------------------------------------------------- |
---|
347 | -- piwigo_sessions |
---|
348 | ----------------------------------------------------------------------------- |
---|
349 | |
---|
350 | DROP TABLE IF EXISTS "piwigo_sessions" CASCADE; |
---|
351 | CREATE TABLE "piwigo_sessions" |
---|
352 | ( |
---|
353 | "id" VARCHAR(255) default '' NOT NULL, |
---|
354 | "data" TEXT NOT NULL, |
---|
355 | "expiration" TIMESTAMP NOT NULL, |
---|
356 | PRIMARY KEY ("id") |
---|
357 | ); |
---|
358 | |
---|
359 | COMMENT ON TABLE "piwigo_sessions" IS ''; |
---|
360 | |
---|
361 | |
---|
362 | SET search_path TO public; |
---|
363 | ----------------------------------------------------------------------------- |
---|
364 | -- piwigo_sites |
---|
365 | ----------------------------------------------------------------------------- |
---|
366 | |
---|
367 | DROP TABLE IF EXISTS "piwigo_sites" CASCADE; |
---|
368 | CREATE TABLE "piwigo_sites" |
---|
369 | ( |
---|
370 | "id" serial NOT NULL, |
---|
371 | "galleries_url" VARCHAR(255) default '' NOT NULL, |
---|
372 | PRIMARY KEY ("id"), |
---|
373 | CONSTRAINT "sites_ui1" UNIQUE ("galleries_url") |
---|
374 | ); |
---|
375 | |
---|
376 | COMMENT ON TABLE "piwigo_sites" IS ''; |
---|
377 | |
---|
378 | |
---|
379 | SET search_path TO public; |
---|
380 | ----------------------------------------------------------------------------- |
---|
381 | -- piwigo_stuffs |
---|
382 | ----------------------------------------------------------------------------- |
---|
383 | |
---|
384 | DROP TABLE IF EXISTS "piwigo_stuffs" CASCADE; |
---|
385 | CREATE TABLE "piwigo_stuffs" |
---|
386 | ( |
---|
387 | "id" INTEGER NOT NULL, |
---|
388 | "pos" INTEGER NOT NULL, |
---|
389 | "name" TEXT NOT NULL, |
---|
390 | "descr" VARCHAR(255), |
---|
391 | "type" VARCHAR(255) NOT NULL, |
---|
392 | "datas" TEXT, |
---|
393 | "users" VARCHAR(255), |
---|
394 | "groups" VARCHAR(255), |
---|
395 | "show_title" CHAR NOT NULL, |
---|
396 | "on_home" CHAR NOT NULL, |
---|
397 | "on_cats" CHAR NOT NULL, |
---|
398 | "on_picture" CHAR NOT NULL, |
---|
399 | "id_line" VARCHAR(1), |
---|
400 | "width" INTEGER, |
---|
401 | PRIMARY KEY ("id") |
---|
402 | ); |
---|
403 | |
---|
404 | COMMENT ON TABLE "piwigo_stuffs" IS ''; |
---|
405 | |
---|
406 | |
---|
407 | SET search_path TO public; |
---|
408 | CREATE INDEX "on_home" ON "piwigo_stuffs" ("on_home"); |
---|
409 | |
---|
410 | CREATE INDEX "on_cats" ON "piwigo_stuffs" ("on_cats"); |
---|
411 | |
---|
412 | CREATE INDEX "on_picture" ON "piwigo_stuffs" ("on_picture"); |
---|
413 | |
---|
414 | ----------------------------------------------------------------------------- |
---|
415 | -- piwigo_tags |
---|
416 | ----------------------------------------------------------------------------- |
---|
417 | |
---|
418 | DROP TABLE IF EXISTS "piwigo_tags" CASCADE; |
---|
419 | CREATE TABLE "piwigo_tags" |
---|
420 | ( |
---|
421 | "id" serial NOT NULL, |
---|
422 | "name" VARCHAR(255) default '' NOT NULL, |
---|
423 | "url_name" VARCHAR(255) default '' NOT NULL, |
---|
424 | PRIMARY KEY ("id") |
---|
425 | ); |
---|
426 | |
---|
427 | COMMENT ON TABLE "piwigo_tags" IS ''; |
---|
428 | |
---|
429 | |
---|
430 | SET search_path TO public; |
---|
431 | CREATE INDEX "tags_i1" ON "piwigo_tags" ("url_name"); |
---|
432 | |
---|
433 | ----------------------------------------------------------------------------- |
---|
434 | -- piwigo_themes |
---|
435 | ----------------------------------------------------------------------------- |
---|
436 | |
---|
437 | DROP TABLE IF EXISTS "piwigo_themes" CASCADE; |
---|
438 | CREATE TABLE "piwigo_themes" |
---|
439 | ( |
---|
440 | "id" varchar(64) default '' NOT NULL, |
---|
441 | "version" varchar(64) NOT NULL default '0', |
---|
442 | "name" varchar(64) default NULL, |
---|
443 | PRIMARY KEY ("id") |
---|
444 | ); |
---|
445 | |
---|
446 | COMMENT ON TABLE "piwigo_themes" IS ''; |
---|
447 | |
---|
448 | ----------------------------------------------------------------------------- |
---|
449 | -- piwigo_upgrade |
---|
450 | ----------------------------------------------------------------------------- |
---|
451 | |
---|
452 | DROP TABLE IF EXISTS "piwigo_upgrade" CASCADE; |
---|
453 | CREATE TABLE "piwigo_upgrade" |
---|
454 | ( |
---|
455 | "id" VARCHAR(20) default '' NOT NULL, |
---|
456 | "applied" TIMESTAMP NOT NULL, |
---|
457 | "description" VARCHAR(255), |
---|
458 | PRIMARY KEY ("id") |
---|
459 | ); |
---|
460 | |
---|
461 | COMMENT ON TABLE "piwigo_upgrade" IS ''; |
---|
462 | |
---|
463 | |
---|
464 | SET search_path TO public; |
---|
465 | ----------------------------------------------------------------------------- |
---|
466 | -- piwigo_user_access |
---|
467 | ----------------------------------------------------------------------------- |
---|
468 | |
---|
469 | DROP TABLE IF EXISTS "piwigo_user_access" CASCADE; |
---|
470 | CREATE TABLE "piwigo_user_access" |
---|
471 | ( |
---|
472 | "user_id" INTEGER default 0 NOT NULL, |
---|
473 | "cat_id" INTEGER default 0 NOT NULL, |
---|
474 | PRIMARY KEY ("user_id","cat_id") |
---|
475 | ); |
---|
476 | |
---|
477 | COMMENT ON TABLE "piwigo_user_access" IS ''; |
---|
478 | |
---|
479 | |
---|
480 | SET search_path TO public; |
---|
481 | ----------------------------------------------------------------------------- |
---|
482 | -- piwigo_user_cache |
---|
483 | ----------------------------------------------------------------------------- |
---|
484 | |
---|
485 | DROP TYPE IF EXISTS USER_CACHE_IMAGE_ACCESS_TYPE; |
---|
486 | CREATE TYPE USER_CACHE_IMAGE_ACCESS_TYPE AS ENUM('NOT IN','IN'); |
---|
487 | |
---|
488 | DROP TABLE IF EXISTS "piwigo_user_cache" CASCADE; |
---|
489 | CREATE TABLE "piwigo_user_cache" |
---|
490 | ( |
---|
491 | "user_id" INTEGER default 0 NOT NULL, |
---|
492 | "need_update" BOOLEAN default true, |
---|
493 | "cache_update_time" INTEGER default 0 NOT NULL, |
---|
494 | "forbidden_categories" TEXT, |
---|
495 | "nb_total_images" INTEGER, |
---|
496 | "image_access_type" USER_CACHE_IMAGE_ACCESS_TYPE default 'NOT IN'::USER_CACHE_IMAGE_ACCESS_TYPE, |
---|
497 | "image_access_list" TEXT, |
---|
498 | PRIMARY KEY ("user_id") |
---|
499 | ); |
---|
500 | |
---|
501 | COMMENT ON TABLE "piwigo_user_cache" IS ''; |
---|
502 | |
---|
503 | |
---|
504 | SET search_path TO public; |
---|
505 | ----------------------------------------------------------------------------- |
---|
506 | -- piwigo_user_cache_categories |
---|
507 | ----------------------------------------------------------------------------- |
---|
508 | |
---|
509 | DROP TABLE IF EXISTS "piwigo_user_cache_categories" CASCADE; |
---|
510 | CREATE TABLE "piwigo_user_cache_categories" |
---|
511 | ( |
---|
512 | "user_id" INTEGER default 0 NOT NULL, |
---|
513 | "cat_id" INTEGER default 0 NOT NULL, |
---|
514 | "date_last" TIMESTAMP, |
---|
515 | "max_date_last" TIMESTAMP, |
---|
516 | "nb_images" INTEGER default 0 NOT NULL, |
---|
517 | "count_images" INTEGER default 0, |
---|
518 | "count_categories" INTEGER default 0, |
---|
519 | "user_representative_picture_id" INTEGER, |
---|
520 | PRIMARY KEY ("user_id","cat_id") |
---|
521 | ); |
---|
522 | |
---|
523 | COMMENT ON TABLE "piwigo_user_cache_categories" IS ''; |
---|
524 | |
---|
525 | |
---|
526 | SET search_path TO public; |
---|
527 | ----------------------------------------------------------------------------- |
---|
528 | -- piwigo_user_feed |
---|
529 | ----------------------------------------------------------------------------- |
---|
530 | |
---|
531 | DROP TABLE IF EXISTS "piwigo_user_feed" CASCADE; |
---|
532 | CREATE TABLE "piwigo_user_feed" |
---|
533 | ( |
---|
534 | "id" VARCHAR(50) default '' NOT NULL, |
---|
535 | "user_id" INTEGER default 0 NOT NULL, |
---|
536 | "last_check" TIMESTAMP, |
---|
537 | PRIMARY KEY ("id") |
---|
538 | ); |
---|
539 | |
---|
540 | COMMENT ON TABLE "piwigo_user_feed" IS ''; |
---|
541 | |
---|
542 | |
---|
543 | SET search_path TO public; |
---|
544 | ----------------------------------------------------------------------------- |
---|
545 | -- piwigo_user_group |
---|
546 | ----------------------------------------------------------------------------- |
---|
547 | |
---|
548 | DROP TABLE IF EXISTS "piwigo_user_group" CASCADE; |
---|
549 | CREATE TABLE "piwigo_user_group" |
---|
550 | ( |
---|
551 | "user_id" INTEGER default 0 NOT NULL, |
---|
552 | "group_id" INTEGER default 0 NOT NULL, |
---|
553 | PRIMARY KEY ("user_id","group_id") |
---|
554 | ); |
---|
555 | |
---|
556 | COMMENT ON TABLE "piwigo_user_group" IS ''; |
---|
557 | |
---|
558 | |
---|
559 | SET search_path TO public; |
---|
560 | ----------------------------------------------------------------------------- |
---|
561 | -- piwigo_user_infos |
---|
562 | ----------------------------------------------------------------------------- |
---|
563 | |
---|
564 | DROP TYPE IF EXISTS USER_INFOS_STATUS; |
---|
565 | CREATE TYPE USER_INFOS_STATUS AS ENUM('webmaster','admin','normal','generic','guest'); |
---|
566 | |
---|
567 | DROP TABLE IF EXISTS "piwigo_user_infos" CASCADE; |
---|
568 | CREATE TABLE "piwigo_user_infos" |
---|
569 | ( |
---|
570 | "user_id" INTEGER default 0 NOT NULL, |
---|
571 | "nb_image_page" INTEGER default 15 NOT NULL, |
---|
572 | "status" USER_INFOS_STATUS default 'guest'::USER_INFOS_STATUS, |
---|
573 | "language" VARCHAR(50) default 'en_UK' NOT NULL, |
---|
574 | "maxwidth" INTEGER, |
---|
575 | "maxheight" INTEGER, |
---|
576 | "expand" BOOLEAN default false, |
---|
577 | "show_nb_comments" BOOLEAN default false, |
---|
578 | "show_nb_hits" BOOLEAN default false, |
---|
579 | "recent_period" INTEGER default 7 NOT NULL, |
---|
580 | "theme" VARCHAR(255) default 'Sylvia' NOT NULL, |
---|
581 | "registration_date" TIMESTAMP NOT NULL, |
---|
582 | "enabled_high" BOOLEAN default true, |
---|
583 | "level" INTEGER default 0 NOT NULL, |
---|
584 | "activation_key" CHAR(20) default NULL, |
---|
585 | PRIMARY KEY ("user_id"), |
---|
586 | CONSTRAINT "user_infos_ui1" UNIQUE ("user_id") |
---|
587 | ); |
---|
588 | |
---|
589 | COMMENT ON TABLE "piwigo_user_infos" IS ''; |
---|
590 | |
---|
591 | |
---|
592 | SET search_path TO public; |
---|
593 | ----------------------------------------------------------------------------- |
---|
594 | -- piwigo_user_mail_notification |
---|
595 | ----------------------------------------------------------------------------- |
---|
596 | |
---|
597 | DROP TABLE IF EXISTS "piwigo_user_mail_notification" CASCADE; |
---|
598 | CREATE TABLE "piwigo_user_mail_notification" |
---|
599 | ( |
---|
600 | "user_id" INTEGER default 0 NOT NULL, |
---|
601 | "check_key" VARCHAR(16) default '' NOT NULL, |
---|
602 | "enabled" BOOLEAN default false, |
---|
603 | "last_send" TIMESTAMP, |
---|
604 | PRIMARY KEY ("user_id"), |
---|
605 | CONSTRAINT "user_mail_notification_ui1" UNIQUE ("check_key") |
---|
606 | ); |
---|
607 | |
---|
608 | COMMENT ON TABLE "piwigo_user_mail_notification" IS ''; |
---|
609 | |
---|
610 | |
---|
611 | SET search_path TO public; |
---|
612 | ----------------------------------------------------------------------------- |
---|
613 | -- piwigo_users |
---|
614 | ----------------------------------------------------------------------------- |
---|
615 | |
---|
616 | DROP TABLE IF EXISTS "piwigo_users" CASCADE; |
---|
617 | CREATE TABLE "piwigo_users" |
---|
618 | ( |
---|
619 | "id" serial NOT NULL, |
---|
620 | "username" VARCHAR(100) default '' NOT NULL, |
---|
621 | "password" VARCHAR(32), |
---|
622 | "mail_address" VARCHAR(255), |
---|
623 | PRIMARY KEY ("id"), |
---|
624 | CONSTRAINT "users_ui1" UNIQUE ("username") |
---|
625 | ); |
---|
626 | |
---|
627 | COMMENT ON TABLE "piwigo_users" IS ''; |
---|
628 | |
---|
629 | |
---|
630 | SET search_path TO public; |
---|
631 | |
---|
632 | ----------------------------------------------------------------------------- |
---|
633 | -- piwigo_comments |
---|
634 | ----------------------------------------------------------------------------- |
---|
635 | |
---|
636 | DROP TABLE IF EXISTS "piwigo_comments" CASCADE; |
---|
637 | CREATE TABLE "piwigo_comments" |
---|
638 | ( |
---|
639 | "id" serial NOT NULL, |
---|
640 | "image_id" INTEGER default 0 NOT NULL, |
---|
641 | "date" TIMESTAMP NOT NULL, |
---|
642 | "author" VARCHAR(255), |
---|
643 | "content" TEXT, |
---|
644 | "validated" BOOLEAN default false, |
---|
645 | "validation_date" TIMESTAMP, |
---|
646 | "author_id" INTEGER REFERENCES "piwigo_users" (id), |
---|
647 | PRIMARY KEY ("id") |
---|
648 | ); |
---|
649 | |
---|
650 | COMMENT ON TABLE "piwigo_comments" IS ''; |
---|
651 | |
---|
652 | |
---|
653 | SET search_path TO public; |
---|
654 | CREATE INDEX "comments_i2" ON "piwigo_comments" ("validation_date"); |
---|
655 | |
---|
656 | CREATE INDEX "comments_i1" ON "piwigo_comments" ("image_id"); |
---|