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