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

Last change on this file since 15231 was 13849, checked in by plg, 12 years ago

feature 2604: add images.rotation at database creation (not only during upgrade)

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