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