source: trunk/install/phpwebgallery_structure.sql @ 1064

Last change on this file since 1064 was 1064, checked in by plg, 18 years ago

new feature: source/destination links between categories. Will we keep this
feature? Code is complicated and very few people will understand how it
works...

modification: #images.storage_category_id replaced by
#image_category.is_storage

improvement: many code refactoring to improve readibility

improvement: virtual category creation code was moved to a dedicated
function in order to be called from admin/cat_list.php and
admin/cat_modify.php (create a new destination category)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 10.8 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 `phpwebgallery_caddie`
9--
10
11DROP TABLE IF EXISTS `phpwebgallery_caddie`;
12CREATE TABLE `phpwebgallery_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) TYPE=MyISAM;
17
18--
19-- Table structure for table `phpwebgallery_categories`
20--
21
22DROP TABLE IF EXISTS `phpwebgallery_categories`;
23CREATE TABLE `phpwebgallery_categories` (
24  `id` smallint(5) unsigned NOT NULL auto_increment,
25  `date_last` datetime default NULL,
26  `nb_images` mediumint(8) unsigned NOT NULL default '0',
27  `name` varchar(255) NOT NULL default '',
28  `id_uppercat` smallint(5) unsigned default NULL,
29  `comment` text,
30  `dir` varchar(255) default NULL,
31  `rank` tinyint(3) unsigned default NULL,
32  `status` enum('public','private') NOT NULL default 'public',
33  `site_id` tinyint(4) unsigned default '1',
34  `visible` enum('true','false') NOT NULL default 'true',
35  `uploadable` enum('true','false') NOT NULL default 'false',
36  `representative_picture_id` mediumint(8) unsigned default NULL,
37  `uppercats` varchar(255) NOT NULL default '',
38  `commentable` enum('true','false') NOT NULL default 'true',
39  `global_rank` varchar(255) default NULL,
40  PRIMARY KEY  (`id`),
41  KEY `categories_i2` (`id_uppercat`)
42) TYPE=MyISAM;
43
44--
45-- Table structure for table `phpwebgallery_categories_link`
46--
47
48DROP TABLE IF EXISTS `phpwebgallery_categories_link`;
49CREATE TABLE `phpwebgallery_categories_link` (
50  `source` smallint(5) unsigned NOT NULL default '0',
51  `destination` smallint(5) unsigned NOT NULL default '0',
52  PRIMARY KEY  (`source`,`destination`)
53) TYPE=MyISAM;
54
55--
56-- Table structure for table `phpwebgallery_comments`
57--
58
59DROP TABLE IF EXISTS `phpwebgallery_comments`;
60CREATE TABLE `phpwebgallery_comments` (
61  `id` int(11) unsigned NOT NULL auto_increment,
62  `image_id` mediumint(8) unsigned NOT NULL default '0',
63  `date` datetime NOT NULL default '0000-00-00 00:00:00',
64  `author` varchar(255) default NULL,
65  `content` longtext,
66  `validated` enum('true','false') NOT NULL default 'false',
67  `validation_date` datetime default NULL,
68  PRIMARY KEY  (`id`),
69  KEY `comments_i2` (`validation_date`),
70  KEY `comments_i1` (`image_id`)
71) TYPE=MyISAM;
72
73--
74-- Table structure for table `phpwebgallery_config`
75--
76
77DROP TABLE IF EXISTS `phpwebgallery_config`;
78CREATE TABLE `phpwebgallery_config` (
79  `param` varchar(40) NOT NULL default '',
80  `value` varchar(255) default NULL,
81  `comment` varchar(255) default NULL,
82  PRIMARY KEY  (`param`)
83) TYPE=MyISAM COMMENT='configuration table';
84
85--
86-- Table structure for table `phpwebgallery_favorites`
87--
88
89DROP TABLE IF EXISTS `phpwebgallery_favorites`;
90CREATE TABLE `phpwebgallery_favorites` (
91  `user_id` smallint(5) NOT NULL default '0',
92  `image_id` mediumint(8) unsigned NOT NULL default '0',
93  PRIMARY KEY  (`user_id`,`image_id`)
94) TYPE=MyISAM;
95
96--
97-- Table structure for table `phpwebgallery_group_access`
98--
99
100DROP TABLE IF EXISTS `phpwebgallery_group_access`;
101CREATE TABLE `phpwebgallery_group_access` (
102  `group_id` smallint(5) unsigned NOT NULL default '0',
103  `cat_id` smallint(5) unsigned NOT NULL default '0',
104  PRIMARY KEY  (`group_id`,`cat_id`)
105) TYPE=MyISAM;
106
107--
108-- Table structure for table `phpwebgallery_groups`
109--
110
111DROP TABLE IF EXISTS `phpwebgallery_groups`;
112CREATE TABLE `phpwebgallery_groups` (
113  `id` smallint(5) unsigned NOT NULL auto_increment,
114  `name` varchar(255) NOT NULL default '',
115  PRIMARY KEY  (`id`)
116) TYPE=MyISAM;
117
118--
119-- Table structure for table `phpwebgallery_history`
120--
121
122DROP TABLE IF EXISTS `phpwebgallery_history`;
123CREATE TABLE `phpwebgallery_history` (
124  `date` datetime NOT NULL default '0000-00-00 00:00:00',
125  `login` varchar(15) default NULL,
126  `IP` varchar(50) NOT NULL default '',
127  `category` varchar(150) default NULL,
128  `file` varchar(50) default NULL,
129  `picture` varchar(150) default NULL,
130  KEY `history_i1` (`date`)
131) TYPE=MyISAM;
132
133--
134-- Table structure for table `phpwebgallery_image_category`
135--
136
137DROP TABLE IF EXISTS `phpwebgallery_image_category`;
138CREATE TABLE `phpwebgallery_image_category` (
139  `image_id` mediumint(8) unsigned NOT NULL default '0',
140  `category_id` smallint(5) unsigned NOT NULL default '0',
141  `is_storage` enum('true','false') default 'false',
142  PRIMARY KEY  (`image_id`,`category_id`),
143  KEY `image_category_i1` (`image_id`),
144  KEY `image_category_i2` (`category_id`)
145) TYPE=MyISAM;
146
147--
148-- Table structure for table `phpwebgallery_images`
149--
150
151DROP TABLE IF EXISTS `phpwebgallery_images`;
152CREATE TABLE `phpwebgallery_images` (
153  `id` mediumint(8) unsigned NOT NULL auto_increment,
154  `file` varchar(255) NOT NULL default '',
155  `date_available` datetime NOT NULL default '0000-00-00 00:00:00',
156  `date_creation` date default NULL,
157  `tn_ext` varchar(4) default '',
158  `name` varchar(255) default NULL,
159  `comment` text,
160  `author` varchar(255) default NULL,
161  `hit` int(10) unsigned NOT NULL default '0',
162  `filesize` mediumint(9) unsigned default NULL,
163  `width` smallint(9) unsigned default NULL,
164  `height` smallint(9) unsigned default NULL,
165  `keywords` varchar(255) default NULL,
166  `storage_category_id` smallint(5) unsigned default NULL,
167  `representative_ext` varchar(4) default NULL,
168  `date_metadata_update` date default NULL,
169  `average_rate` float(5,2) unsigned default NULL,
170  `has_high` enum('true') default NULL,
171  `path` varchar(255) NOT NULL default '',
172  PRIMARY KEY  (`id`),
173  KEY `images_i2` (`date_available`),
174  KEY `images_i1` (`storage_category_id`),
175  KEY `images_i3` (`average_rate`),
176  KEY `images_i4` (`hit`),
177  KEY `images_i5` (`date_creation`)
178) TYPE=MyISAM;
179
180--
181-- Table structure for table `phpwebgallery_rate`
182--
183
184DROP TABLE IF EXISTS `phpwebgallery_rate`;
185CREATE TABLE `phpwebgallery_rate` (
186  `user_id` smallint(5) NOT NULL default '0',
187  `element_id` mediumint(8) unsigned NOT NULL default '0',
188  `anonymous_id` varchar(45) NOT NULL default '',
189  `rate` tinyint(2) unsigned NOT NULL default '0',
190  `date` date NOT NULL default '0000-00-00',
191  PRIMARY KEY  (`element_id`,`user_id`,`anonymous_id`)
192) TYPE=MyISAM;
193
194--
195-- Table structure for table `phpwebgallery_search`
196--
197
198DROP TABLE IF EXISTS `phpwebgallery_search`;
199CREATE TABLE `phpwebgallery_search` (
200  `id` int(10) unsigned NOT NULL auto_increment,
201  `last_seen` date default NULL,
202  `rules` text,
203  PRIMARY KEY  (`id`)
204) TYPE=MyISAM;
205
206--
207-- Table structure for table `phpwebgallery_sessions`
208--
209
210DROP TABLE IF EXISTS `phpwebgallery_sessions`;
211CREATE TABLE `phpwebgallery_sessions` (
212  `id` varchar(255) binary NOT NULL default '',
213  `data` text NOT NULL,
214  `expiration` datetime NOT NULL default '0000-00-00 00:00:00',
215  PRIMARY KEY  (`id`)
216) TYPE=MyISAM;
217
218--
219-- Table structure for table `phpwebgallery_sites`
220--
221
222DROP TABLE IF EXISTS `phpwebgallery_sites`;
223CREATE TABLE `phpwebgallery_sites` (
224  `id` tinyint(4) NOT NULL auto_increment,
225  `galleries_url` varchar(255) NOT NULL default '',
226  PRIMARY KEY  (`id`),
227  UNIQUE KEY `sites_ui1` (`galleries_url`)
228) TYPE=MyISAM;
229
230--
231-- Table structure for table `phpwebgallery_upgrade`
232--
233
234DROP TABLE IF EXISTS `phpwebgallery_upgrade`;
235CREATE TABLE `phpwebgallery_upgrade` (
236  `id` varchar(20) NOT NULL default '',
237  `applied` datetime NOT NULL default '0000-00-00 00:00:00',
238  `description` varchar(255) default NULL,
239  PRIMARY KEY  (`id`)
240) TYPE=MyISAM;
241
242--
243-- Table structure for table `phpwebgallery_user_access`
244--
245
246DROP TABLE IF EXISTS `phpwebgallery_user_access`;
247CREATE TABLE `phpwebgallery_user_access` (
248  `user_id` smallint(5) NOT NULL default '0',
249  `cat_id` smallint(5) unsigned NOT NULL default '0',
250  PRIMARY KEY  (`user_id`,`cat_id`)
251) TYPE=MyISAM;
252
253--
254-- Table structure for table `phpwebgallery_user_cache`
255--
256
257DROP TABLE IF EXISTS `phpwebgallery_user_cache`;
258CREATE TABLE `phpwebgallery_user_cache` (
259  `user_id` smallint(5) NOT NULL default '0',
260  `need_update` enum('true','false') NOT NULL default 'true',
261  `forbidden_categories` text,
262  PRIMARY KEY  (`user_id`)
263) TYPE=MyISAM;
264
265--
266-- Table structure for table `phpwebgallery_user_feed`
267--
268
269DROP TABLE IF EXISTS `phpwebgallery_user_feed`;
270CREATE TABLE `phpwebgallery_user_feed` (
271  `id` varchar(50) binary NOT NULL default '',
272  `user_id` smallint(5) NOT NULL default '0',
273  `last_check` datetime default NULL,
274  PRIMARY KEY  (`id`)
275) TYPE=MyISAM;
276
277--
278-- Table structure for table `phpwebgallery_user_group`
279--
280
281DROP TABLE IF EXISTS `phpwebgallery_user_group`;
282CREATE TABLE `phpwebgallery_user_group` (
283  `user_id` smallint(5) NOT NULL default '0',
284  `group_id` smallint(5) unsigned NOT NULL default '0',
285  PRIMARY KEY  (`group_id`,`user_id`)
286) TYPE=MyISAM;
287
288--
289-- Table structure for table `phpwebgallery_user_infos`
290--
291
292DROP TABLE IF EXISTS `phpwebgallery_user_infos`;
293CREATE TABLE `phpwebgallery_user_infos` (
294  `user_id` smallint(5) NOT NULL default '0',
295  `nb_image_line` tinyint(1) unsigned NOT NULL default '5',
296  `nb_line_page` tinyint(3) unsigned NOT NULL default '3',
297  `status` enum('admin','guest') NOT NULL default 'guest',
298  `language` varchar(50) NOT NULL default 'english',
299  `maxwidth` smallint(6) default NULL,
300  `maxheight` smallint(6) default NULL,
301  `expand` enum('true','false') NOT NULL default 'false',
302  `show_nb_comments` enum('true','false') NOT NULL default 'false',
303  `recent_period` tinyint(3) unsigned NOT NULL default '7',
304  `template` varchar(255) NOT NULL default 'yoga/clear',
305  `registration_date` datetime NOT NULL default '0000-00-00 00:00:00',
306  UNIQUE KEY `user_infos_ui1` (`user_id`)
307) TYPE=MyISAM;
308
309--
310-- Table structure for table `phpwebgallery_user_mail_notification`
311--
312
313DROP TABLE IF EXISTS `phpwebgallery_user_mail_notification`;
314CREATE TABLE `phpwebgallery_user_mail_notification` (
315  `user_id` smallint(5) NOT NULL default '0',
316  `check_key` varchar(128) binary NOT NULL default '',
317  `enabled` enum('true','false') NOT NULL default 'false',
318  `last_send` datetime default NULL,
319  PRIMARY KEY  (`user_id`),
320  UNIQUE KEY `uidx_check_key` (`check_key`)
321) TYPE=MyISAM;
322
323--
324-- Table structure for table `phpwebgallery_users`
325--
326
327DROP TABLE IF EXISTS `phpwebgallery_users`;
328CREATE TABLE `phpwebgallery_users` (
329  `id` smallint(5) NOT NULL auto_increment,
330  `username` varchar(20) binary NOT NULL default '',
331  `password` varchar(32) default NULL,
332  `mail_address` varchar(255) default NULL,
333  PRIMARY KEY  (`id`),
334  UNIQUE KEY `users_ui1` (`username`)
335) TYPE=MyISAM;
336
337--
338-- Table structure for table `phpwebgallery_waiting`
339--
340
341DROP TABLE IF EXISTS `phpwebgallery_waiting`;
342CREATE TABLE `phpwebgallery_waiting` (
343  `id` int(10) unsigned NOT NULL auto_increment,
344  `storage_category_id` smallint(5) unsigned NOT NULL default '0',
345  `file` varchar(255) NOT NULL default '',
346  `username` varchar(255) NOT NULL default '',
347  `mail_address` varchar(255) NOT NULL default '',
348  `date` int(10) unsigned NOT NULL default '0',
349  `tn_ext` char(3) default NULL,
350  `validated` enum('true','false') NOT NULL default 'false',
351  `infos` text,
352  PRIMARY KEY  (`id`)
353) TYPE=MyISAM;
354
Note: See TracBrowser for help on using the repository browser.