source: trunk/install/piwigo_structure-mysql.sql @ 15983

Last change on this file since 15983 was 15983, checked in by mistic100, 12 years ago

bug 2660: check guest IP on insert_user_comment (same system as rate_picture)

  • Property svn:eol-style set to LF
File size: 13.4 KB
RevLine 
[1727]1-- MySQL dump 9.11
[381]2--
[1064]3-- Host: localhost    Database: pwg-bsf
[801]4-- ------------------------------------------------------
[1064]5-- Server version       4.0.24_Debian-10-log
[381]6
7--
[2339]8-- Table structure for table `piwigo_caddie`
[757]9--
10
[2339]11DROP TABLE IF EXISTS `piwigo_caddie`;
12CREATE TABLE `piwigo_caddie` (
[801]13  `user_id` smallint(5) NOT NULL default '0',
14  `element_id` mediumint(8) NOT NULL default '0',
15  PRIMARY KEY  (`user_id`,`element_id`)
[9086]16) ENGINE=MyISAM;
[757]17
18--
[2339]19-- Table structure for table `piwigo_categories`
[381]20--
21
[2339]22DROP TABLE IF EXISTS `piwigo_categories`;
23CREATE TABLE `piwigo_categories` (
[801]24  `id` smallint(5) unsigned NOT NULL auto_increment,
25  `name` varchar(255) NOT NULL default '',
26  `id_uppercat` smallint(5) unsigned default NULL,
27  `comment` text,
28  `dir` varchar(255) default NULL,
[1312]29  `rank` smallint(5) unsigned default NULL,
[801]30  `status` enum('public','private') NOT NULL default 'public',
31  `site_id` tinyint(4) unsigned default '1',
32  `visible` enum('true','false') NOT NULL default 'true',
33  `representative_picture_id` mediumint(8) unsigned default NULL,
34  `uppercats` varchar(255) NOT NULL default '',
35  `commentable` enum('true','false') NOT NULL default 'true',
36  `global_rank` varchar(255) default NULL,
[1500]37  `image_order` varchar(128) default NULL,
[2521]38  `permalink` varchar(64) binary default NULL,
[801]39  PRIMARY KEY  (`id`),
[1883]40  UNIQUE KEY `categories_i3` (`permalink`),
41  KEY `categories_i2` (`id_uppercat`)
[9086]42) ENGINE=MyISAM;
[381]43
44--
[2339]45-- Table structure for table `piwigo_comments`
[381]46--
47
[2339]48DROP TABLE IF EXISTS `piwigo_comments`;
49CREATE TABLE `piwigo_comments` (
[801]50  `id` int(11) unsigned NOT NULL auto_increment,
51  `image_id` mediumint(8) unsigned NOT NULL default '0',
52  `date` datetime NOT NULL default '0000-00-00 00:00:00',
53  `author` varchar(255) default NULL,
[3979]54  `author_id` smallint(5) DEFAULT NULL,
[15983]55  `anonymous_id` varchar(45) NOT NULL,
[801]56  `content` longtext,
57  `validated` enum('true','false') NOT NULL default 'false',
58  `validation_date` datetime default NULL,
59  PRIMARY KEY  (`id`),
60  KEY `comments_i2` (`validation_date`),
61  KEY `comments_i1` (`image_id`)
[9086]62) ENGINE=MyISAM;
[381]63
64--
[2339]65-- Table structure for table `piwigo_config`
[381]66--
67
[2339]68DROP TABLE IF EXISTS `piwigo_config`;
69CREATE TABLE `piwigo_config` (
[801]70  `param` varchar(40) NOT NULL default '',
[1071]71  `value` text,
[801]72  `comment` varchar(255) default NULL,
73  PRIMARY KEY  (`param`)
[9086]74) ENGINE=MyISAM COMMENT='configuration table';
[381]75
76--
[2339]77-- Table structure for table `piwigo_favorites`
[381]78--
79
[2339]80DROP TABLE IF EXISTS `piwigo_favorites`;
81CREATE TABLE `piwigo_favorites` (
[858]82  `user_id` smallint(5) NOT NULL default '0',
[801]83  `image_id` mediumint(8) unsigned NOT NULL default '0',
84  PRIMARY KEY  (`user_id`,`image_id`)
[9086]85) ENGINE=MyISAM;
[381]86
87--
[2339]88-- Table structure for table `piwigo_group_access`
[381]89--
90
[2339]91DROP TABLE IF EXISTS `piwigo_group_access`;
92CREATE TABLE `piwigo_group_access` (
[801]93  `group_id` smallint(5) unsigned NOT NULL default '0',
94  `cat_id` smallint(5) unsigned NOT NULL default '0',
95  PRIMARY KEY  (`group_id`,`cat_id`)
[9086]96) ENGINE=MyISAM;
[381]97
98--
[2339]99-- Table structure for table `piwigo_groups`
[381]100--
101
[2339]102DROP TABLE IF EXISTS `piwigo_groups`;
103CREATE TABLE `piwigo_groups` (
[801]104  `id` smallint(5) unsigned NOT NULL auto_increment,
105  `name` varchar(255) NOT NULL default '',
[1583]106  `is_default` enum('true','false') NOT NULL default 'false',
[1963]107  PRIMARY KEY  (`id`),
108  UNIQUE KEY `groups_ui1` (`name`)
[9086]109) ENGINE=MyISAM;
[381]110
111--
[2339]112-- Table structure for table `piwigo_history`
[381]113--
114
[2339]115DROP TABLE IF EXISTS `piwigo_history`;
116CREATE TABLE `piwigo_history` (
[1727]117  `id` int(10) unsigned NOT NULL auto_increment,
118  `date` date NOT NULL default '0000-00-00',
119  `time` time NOT NULL default '00:00:00',
120  `user_id` smallint(5) NOT NULL default '0',
121  `IP` varchar(15) NOT NULL default '',
122  `section` enum('categories','tags','search','list','favorites','most_visited','best_rated','recent_pics','recent_cats') default NULL,
123  `category_id` smallint(5) default NULL,
124  `tag_ids` varchar(50) default NULL,
125  `image_id` mediumint(8) default NULL,
126  `summarized` enum('true','false') default 'false',
[1844]127  `image_type` enum('picture','high','other') default NULL,
[1727]128  PRIMARY KEY  (`id`),
129  KEY `history_i1` (`summarized`)
[9086]130) ENGINE=MyISAM;
[381]131
132--
[2339]133-- Table structure for table `piwigo_history_summary`
[1727]134--
135
[2339]136DROP TABLE IF EXISTS `piwigo_history_summary`;
137CREATE TABLE `piwigo_history_summary` (
[1727]138  `year` smallint(4) NOT NULL default '0',
139  `month` tinyint(2) default NULL,
140  `day` tinyint(2) default NULL,
141  `hour` tinyint(2) default NULL,
142  `nb_pages` int(11) default NULL,
[2333]143  UNIQUE KEY history_summary_ymdh (`year`,`month`,`day`,`hour`)
[9086]144) ENGINE=MyISAM;
[1727]145
146--
[2339]147-- Table structure for table `piwigo_image_category`
[381]148--
149
[2339]150DROP TABLE IF EXISTS `piwigo_image_category`;
151CREATE TABLE `piwigo_image_category` (
[801]152  `image_id` mediumint(8) unsigned NOT NULL default '0',
153  `category_id` smallint(5) unsigned NOT NULL default '0',
[2517]154  `rank` mediumint(8) unsigned default NULL,
[801]155  PRIMARY KEY  (`image_id`,`category_id`),
[1925]156  KEY `image_category_i1` (`category_id`)
[9086]157) ENGINE=MyISAM;
[381]158
159--
[2339]160-- Table structure for table `piwigo_image_tag`
[1119]161--
162
[2339]163DROP TABLE IF EXISTS `piwigo_image_tag`;
164CREATE TABLE `piwigo_image_tag` (
[1119]165  `image_id` mediumint(8) unsigned NOT NULL default '0',
166  `tag_id` smallint(5) unsigned NOT NULL default '0',
[1131]167  PRIMARY KEY  (`image_id`,`tag_id`),
168  KEY `image_tag_i1` (`tag_id`)
[9086]169) ENGINE=MyISAM;
[1119]170
171--
[2339]172-- Table structure for table `piwigo_images`
[381]173--
174
[2339]175DROP TABLE IF EXISTS `piwigo_images`;
176CREATE TABLE `piwigo_images` (
[801]177  `id` mediumint(8) unsigned NOT NULL auto_increment,
[2521]178  `file` varchar(255) binary NOT NULL default '',
[801]179  `date_available` datetime NOT NULL default '0000-00-00 00:00:00',
[9073]180  `date_creation` datetime default NULL,
[801]181  `name` varchar(255) default NULL,
182  `comment` text,
183  `author` varchar(255) default NULL,
184  `hit` int(10) unsigned NOT NULL default '0',
185  `filesize` mediumint(9) unsigned default NULL,
186  `width` smallint(9) unsigned default NULL,
187  `height` smallint(9) unsigned default NULL,
[13849]188  `coi` char(4) default NULL COMMENT 'center of interest',
[801]189  `representative_ext` varchar(4) default NULL,
190  `date_metadata_update` date default NULL,
[11893]191  `rating_score` float(5,2) unsigned default NULL,
[801]192  `path` varchar(255) NOT NULL default '',
[1121]193  `storage_category_id` smallint(5) unsigned default NULL,
[2084]194  `level` tinyint unsigned NOT NULL default '0',
[2592]195  `md5sum` char(32) default NULL,
[8464]196  `added_by` smallint(5) NOT NULL default '0',
[13849]197  `rotation` tinyint unsigned default null,
[801]198  PRIMARY KEY  (`id`),
199  KEY `images_i2` (`date_available`),
[11893]200  KEY `images_i3` (`rating_score`),
[801]201  KEY `images_i4` (`hit`),
[1159]202  KEY `images_i5` (`date_creation`),
203  KEY `images_i1` (`storage_category_id`)
[9086]204) ENGINE=MyISAM;
[381]205
206--
[5341]207-- Table structure for table `piwigo_languages`
208--
209
210DROP TABLE IF EXISTS `piwigo_languages`;
211CREATE TABLE `piwigo_languages` (
212  `id` varchar(64) NOT NULL default '',
213  `version` varchar(64) NOT NULL default '0',
214  `name` varchar(64) default NULL,
215  PRIMARY KEY  (`id`)
[9086]216) ENGINE=MyISAM;
[5341]217
218--
[2339]219-- Table structure for table `piwigo_old_permalinks`
[1866]220--
221
[2339]222DROP TABLE IF EXISTS `piwigo_old_permalinks`;
223CREATE TABLE `piwigo_old_permalinks` (
[1883]224  `cat_id` smallint(5) unsigned NOT NULL default '0',
[2521]225  `permalink` varchar(64) binary NOT NULL default '',
[1883]226  `date_deleted` datetime NOT NULL default '0000-00-00 00:00:00',
[1866]227  `last_hit` datetime default NULL,
228  `hit` int(10) unsigned NOT NULL default '0',
[1883]229  PRIMARY KEY  (`permalink`)
[9086]230) ENGINE=MyISAM;
[1866]231
232--
[2339]233-- Table structure for table `piwigo_plugins`
[1584]234--
235
[2339]236DROP TABLE IF EXISTS `piwigo_plugins`;
237CREATE TABLE `piwigo_plugins` (
[1584]238  `id` varchar(64) binary NOT NULL default '',
239  `state` enum('inactive','active') NOT NULL default 'inactive',
240  `version` varchar(64) NOT NULL default '0',
241  PRIMARY KEY  (`id`)
[9086]242) ENGINE=MyISAM;
[1584]243
244--
[2339]245-- Table structure for table `piwigo_rate`
[507]246--
247
[2339]248DROP TABLE IF EXISTS `piwigo_rate`;
249CREATE TABLE `piwigo_rate` (
[858]250  `user_id` smallint(5) NOT NULL default '0',
[801]251  `element_id` mediumint(8) unsigned NOT NULL default '0',
[1041]252  `anonymous_id` varchar(45) NOT NULL default '',
[801]253  `rate` tinyint(2) unsigned NOT NULL default '0',
[1041]254  `date` date NOT NULL default '0000-00-00',
255  PRIMARY KEY  (`element_id`,`user_id`,`anonymous_id`)
[9086]256) ENGINE=MyISAM;
[507]257
258--
[2339]259-- Table structure for table `piwigo_search`
[1008]260--
261
[2339]262DROP TABLE IF EXISTS `piwigo_search`;
263CREATE TABLE `piwigo_search` (
[1008]264  `id` int(10) unsigned NOT NULL auto_increment,
265  `last_seen` date default NULL,
266  `rules` text,
267  PRIMARY KEY  (`id`)
[9086]268) ENGINE=MyISAM;
[1008]269
270--
[2339]271-- Table structure for table `piwigo_sessions`
[381]272--
273
[2339]274DROP TABLE IF EXISTS `piwigo_sessions`;
275CREATE TABLE `piwigo_sessions` (
[801]276  `id` varchar(255) binary NOT NULL default '',
[2323]277  `data` mediumtext NOT NULL,
[801]278  `expiration` datetime NOT NULL default '0000-00-00 00:00:00',
279  PRIMARY KEY  (`id`)
[9086]280) ENGINE=MyISAM;
[381]281
282--
[2339]283-- Table structure for table `piwigo_sites`
[381]284--
285
[2339]286DROP TABLE IF EXISTS `piwigo_sites`;
287CREATE TABLE `piwigo_sites` (
[801]288  `id` tinyint(4) NOT NULL auto_increment,
289  `galleries_url` varchar(255) NOT NULL default '',
290  PRIMARY KEY  (`id`),
291  UNIQUE KEY `sites_ui1` (`galleries_url`)
[9086]292) ENGINE=MyISAM;
[381]293
294--
[2339]295-- Table structure for table `piwigo_tags`
[1119]296--
297
[2339]298DROP TABLE IF EXISTS `piwigo_tags`;
299CREATE TABLE `piwigo_tags` (
[1119]300  `id` smallint(5) unsigned NOT NULL auto_increment,
301  `name` varchar(255) binary NOT NULL default '',
302  `url_name` varchar(255) binary NOT NULL default '',
[1131]303  PRIMARY KEY  (`id`),
304  KEY `tags_i1` (`url_name`)
[9086]305) ENGINE=MyISAM;
[1119]306
307--
[5153]308-- Table structure for table `piwigo_themes`
309--
310
311DROP TABLE IF EXISTS `piwigo_themes`;
312CREATE TABLE `piwigo_themes` (
313  `id` varchar(64) NOT NULL default '',
314  `version` varchar(64) NOT NULL default '0',
315  `name` varchar(64) default NULL,
316  PRIMARY KEY  (`id`)
[9086]317) ENGINE=MyISAM;
[5153]318
319--
[2339]320-- Table structure for table `piwigo_upgrade`
[953]321--
322
[2339]323DROP TABLE IF EXISTS `piwigo_upgrade`;
324CREATE TABLE `piwigo_upgrade` (
[953]325  `id` varchar(20) NOT NULL default '',
326  `applied` datetime NOT NULL default '0000-00-00 00:00:00',
327  `description` varchar(255) default NULL,
328  PRIMARY KEY  (`id`)
[9086]329) ENGINE=MyISAM;
[953]330
331--
[2339]332-- Table structure for table `piwigo_user_access`
[381]333--
334
[2339]335DROP TABLE IF EXISTS `piwigo_user_access`;
336CREATE TABLE `piwigo_user_access` (
[858]337  `user_id` smallint(5) NOT NULL default '0',
[801]338  `cat_id` smallint(5) unsigned NOT NULL default '0',
339  PRIMARY KEY  (`user_id`,`cat_id`)
[9086]340) ENGINE=MyISAM;
[381]341
342--
[2339]343-- Table structure for table `piwigo_user_cache`
[648]344--
345
[2339]346DROP TABLE IF EXISTS `piwigo_user_cache`;
347CREATE TABLE `piwigo_user_cache` (
[858]348  `user_id` smallint(5) NOT NULL default '0',
[801]349  `need_update` enum('true','false') NOT NULL default 'true',
[2448]350  `cache_update_time` integer unsigned NOT NULL default 0,
[2323]351  `forbidden_categories` mediumtext,
[1119]352  `nb_total_images` mediumint(8) unsigned default NULL,
[2084]353  `image_access_type` enum('NOT IN','IN') NOT NULL default 'NOT IN',
[2323]354  `image_access_list` mediumtext default NULL,
[801]355  PRIMARY KEY  (`user_id`)
[9086]356) ENGINE=MyISAM;
[648]357
358--
[2339]359-- Table structure for table `piwigo_user_cache_categories`
[1624]360--
361
[2339]362DROP TABLE IF EXISTS `piwigo_user_cache_categories`;
363CREATE TABLE `piwigo_user_cache_categories` (
[1624]364  `user_id` smallint(5) NOT NULL default '0',
365  `cat_id` smallint(5) unsigned NOT NULL default '0',
[2324]366  `date_last` datetime default NULL,
[1624]367  `max_date_last` datetime default NULL,
[2324]368  `nb_images` mediumint(8) unsigned NOT NULL default '0',
[1727]369  `count_images` mediumint(8) unsigned default '0',
370  `count_categories` mediumint(8) unsigned default '0',
[8802]371  `user_representative_picture_id` mediumint(8) unsigned default NULL,
[1727]372  PRIMARY KEY  (`user_id`,`cat_id`)
[9086]373) ENGINE=MyISAM;
[1624]374
375--
[2339]376-- Table structure for table `piwigo_user_feed`
[833]377--
378
[2339]379DROP TABLE IF EXISTS `piwigo_user_feed`;
380CREATE TABLE `piwigo_user_feed` (
[833]381  `id` varchar(50) binary NOT NULL default '',
[858]382  `user_id` smallint(5) NOT NULL default '0',
[833]383  `last_check` datetime default NULL,
384  PRIMARY KEY  (`id`)
[9086]385) ENGINE=MyISAM;
[833]386
387--
[2339]388-- Table structure for table `piwigo_user_group`
[381]389--
390
[2339]391DROP TABLE IF EXISTS `piwigo_user_group`;
392CREATE TABLE `piwigo_user_group` (
[858]393  `user_id` smallint(5) NOT NULL default '0',
[801]394  `group_id` smallint(5) unsigned NOT NULL default '0',
395  PRIMARY KEY  (`group_id`,`user_id`)
[9086]396) ENGINE=MyISAM;
[381]397
398--
[2339]399-- Table structure for table `piwigo_user_infos`
[381]400--
401
[2339]402DROP TABLE IF EXISTS `piwigo_user_infos`;
403CREATE TABLE `piwigo_user_infos` (
[858]404  `user_id` smallint(5) NOT NULL default '0',
[10341]405  `nb_image_page` smallint(3) unsigned NOT NULL default '15',
[1119]406  `status` enum('webmaster','admin','normal','generic','guest') NOT NULL default 'guest',
[2127]407  `language` varchar(50) NOT NULL default 'en_UK',
[801]408  `expand` enum('true','false') NOT NULL default 'false',
409  `show_nb_comments` enum('true','false') NOT NULL default 'false',
[1762]410  `show_nb_hits` enum('true','false') NOT NULL default 'false',
[801]411  `recent_period` tinyint(3) unsigned NOT NULL default '7',
[13467]412  `theme` varchar(255) NOT NULL default 'elegant',
[801]413  `registration_date` datetime NOT NULL default '0000-00-00 00:00:00',
[1078]414  `enabled_high` enum('true','false') NOT NULL default 'true',
[2084]415  `level` tinyint unsigned NOT NULL default '0',
[11992]416  `activation_key` char(20) default NULL,
[808]417  UNIQUE KEY `user_infos_ui1` (`user_id`)
[9086]418) ENGINE=MyISAM;
[808]419
420--
[2339]421-- Table structure for table `piwigo_user_mail_notification`
[1064]422--
423
[2339]424DROP TABLE IF EXISTS `piwigo_user_mail_notification`;
425CREATE TABLE `piwigo_user_mail_notification` (
[1064]426  `user_id` smallint(5) NOT NULL default '0',
[1116]427  `check_key` varchar(16) binary NOT NULL default '',
[1064]428  `enabled` enum('true','false') NOT NULL default 'false',
429  `last_send` datetime default NULL,
430  PRIMARY KEY  (`user_id`),
[1925]431  UNIQUE KEY `user_mail_notification_ui1` (`check_key`)
[9086]432) ENGINE=MyISAM;
[1064]433
434--
[2339]435-- Table structure for table `piwigo_users`
[808]436--
437
[2339]438DROP TABLE IF EXISTS `piwigo_users`;
439CREATE TABLE `piwigo_users` (
[858]440  `id` smallint(5) NOT NULL auto_increment,
[1495]441  `username` varchar(100) binary NOT NULL default '',
[808]442  `password` varchar(32) default NULL,
443  `mail_address` varchar(255) default NULL,
[801]444  PRIMARY KEY  (`id`),
445  UNIQUE KEY `users_ui1` (`username`)
[9086]446) ENGINE=MyISAM;
Note: See TracBrowser for help on using the repository browser.