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

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

feature 2380: add URL for user comment

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