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