Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
#*************************
2
#  Coppermine Photo Gallery
3
#  ************************
4
#  Copyright (c) 2003-2005 Coppermine Dev Team
5
#  v1.1 originaly written by Gregory DEMAR
6
#
7
#  This program is free software; you can redistribute it and/or modify
8
#  it under the terms of the GNU General Public License as published by
9
#  the Free Software Foundation; either version 2 of the License, or
10
#  (at your option) any later version.
11
#  ********************************************
12
#  Coppermine version: 1.3.3
13
#  $Source: /cvsroot/coppermine/stable/sql/schema.sql,v $
14
#  $Revision: 1.4 $
15
#  $Author: gaugau $
16
#  $Date: 2005/04/19 03:17:12 $
17
#**********************************************
18
 
19
#
20
# Table structure for table `CPG_albums`
21
#
22
 
23
CREATE TABLE CPG_albums (
24
  aid int(11) NOT NULL auto_increment,
25
  title varchar(255) NOT NULL default '',
26
  description text NOT NULL,
27
  visibility int(11) NOT NULL default '0',
28
  uploads enum('YES','NO') NOT NULL default 'NO',
29
  comments enum('YES','NO') NOT NULL default 'YES',
30
  votes enum('YES','NO') NOT NULL default 'YES',
31
  pos int(11) NOT NULL default '0',
32
  category int(11) NOT NULL default '0',
33
  pic_count int(11) NOT NULL default '0',
34
  thumb int(11) NOT NULL default '0',
35
  last_addition datetime NOT NULL default '0000-00-00 00:00:00',
36
  stat_uptodate enum('YES','NO') NOT NULL default 'NO',
37
  keyword VARCHAR( 50 ),
38
  PRIMARY KEY  (aid),
39
  KEY alb_category (category)
40
) TYPE=MyISAM;
41
# --------------------------------------------------------
42
 
43
#
44
# Table structure for table `CPG_categories`
45
#
46
 
47
CREATE TABLE CPG_categories (
48
  cid int(11) NOT NULL auto_increment,
49
  owner_id int(11) NOT NULL default '0',
50
  name varchar(255) NOT NULL default '',
51
  description text NOT NULL,
52
  pos int(11) NOT NULL default '0',
53
  parent int(11) NOT NULL default '0',
54
  thumb int(11) NOT NULL default '0',
55
  subcat_count int(11) NOT NULL default '0',
56
  alb_count int(11) NOT NULL default '0',
57
  pic_count int(11) NOT NULL default '0',
58
  stat_uptodate enum('YES','NO') NOT NULL default 'NO',
59
  PRIMARY KEY  (cid),
60
  KEY cat_parent (parent),
61
  KEY cat_pos (pos),
62
  KEY cat_owner_id (owner_id)
63
) TYPE=MyISAM;
64
# --------------------------------------------------------
65
 
66
#
67
# Table structure for table `CPG_comments`
68
#
69
 
70
CREATE TABLE CPG_comments (
71
  pid mediumint(10) NOT NULL default '0',
72
  msg_id mediumint(10) NOT NULL auto_increment,
73
  msg_author varchar(25) NOT NULL default '',
74
  msg_body text NOT NULL,
75
  msg_date datetime NOT NULL default '0000-00-00 00:00:00',
76
  msg_raw_ip tinytext,
77
  msg_hdr_ip tinytext,
78
  author_md5_id varchar(32) NOT NULL default '',
79
  author_id int(11) NOT NULL default '0',
80
  PRIMARY KEY  (msg_id),
81
  KEY com_pic_id (pid)
82
) TYPE=MyISAM;
83
# --------------------------------------------------------
84
 
85
#
86
# Table structure for table `CPG_config`
87
#
88
 
89
CREATE TABLE CPG_config (
90
  name varchar(40) NOT NULL default '',
91
  value varchar(255) NOT NULL default '',
92
  PRIMARY KEY  (name)
93
) TYPE=MyISAM;
94
# --------------------------------------------------------
95
 
96
#
97
# Table structure for table `CPG_pictures`
98
#
99
 
100
CREATE TABLE CPG_pictures (
101
  pid int(11) NOT NULL auto_increment,
102
  aid int(11) NOT NULL default '0',
103
  filepath varchar(255) NOT NULL default '',
104
  filename varchar(255) NOT NULL default '',
105
  filesize int(11) NOT NULL default '0',
106
  total_filesize int(11) NOT NULL default '0',
107
  pwidth smallint(6) NOT NULL default '0',
108
  pheight smallint(6) NOT NULL default '0',
109
  hits int(10) NOT NULL default '0',
110
  mtime timestamp(14) NOT NULL,
111
  ctime int(11) NOT NULL default '0',
112
  owner_id int(11) NOT NULL default '0',
113
  owner_name varchar(40) NOT NULL default '',
114
  pic_rating int(11) NOT NULL default '0',
115
  votes int(11) NOT NULL default '0',
116
  title varchar(255) NOT NULL default '',
117
  caption text NOT NULL,
118
  keywords varchar(255) NOT NULL default '',
119
  approved enum('YES','NO') NOT NULL default 'NO',
120
  user1 varchar(255) NOT NULL default '',
121
  user2 varchar(255) NOT NULL default '',
122
  user3 varchar(255) NOT NULL default '',
123
  user4 varchar(255) NOT NULL default '',
124
  url_prefix tinyint(4) NOT NULL default '0',
125
  randpos int(11) NOT NULL default '0',
126
  pic_raw_ip tinytext,
127
  pic_hdr_ip tinytext,
128
  PRIMARY KEY  (pid),
129
  KEY owner_id (owner_id),
130
  KEY pic_hits (hits),
131
  KEY pic_rate (pic_rating),
132
  KEY aid_approved (aid,approved),
133
  KEY randpos (randpos),
134
  KEY pic_aid (aid),
135
  FULLTEXT KEY search (title,caption,keywords,filename)
136
) TYPE=MyISAM;
137
# --------------------------------------------------------
138
 
139
#
140
# Table structure for table `CPG_usergroups`
141
#
142
 
143
CREATE TABLE CPG_usergroups (
144
  group_id int(11) NOT NULL auto_increment,
145
  group_name varchar(255) NOT NULL default '',
146
  group_quota int(11) NOT NULL default '0',
147
  has_admin_access tinyint(4) NOT NULL default '0',
148
  can_rate_pictures tinyint(4) NOT NULL default '0',
149
  can_send_ecards tinyint(4) NOT NULL default '0',
150
  can_post_comments tinyint(4) NOT NULL default '0',
151
  can_upload_pictures tinyint(4) NOT NULL default '0',
152
  can_create_albums tinyint(4) NOT NULL default '0',
153
  pub_upl_need_approval tinyint(4) NOT NULL default '1',
154
  priv_upl_need_approval tinyint(4) NOT NULL default '1',
155
  upload_form_config tinyint(4) NOT NULL default '3',
156
  custom_user_upload tinyint(4) NOT NULL default '0',
157
  num_file_upload tinyint(4) NOT NULL default '5',
158
  num_URI_upload tinyint(4) NOT NULL default '3',
159
  PRIMARY KEY  (group_id)
160
) TYPE=MyISAM;
161
# --------------------------------------------------------
162
 
163
#
164
# Table structure for table `CPG_users`
165
#
166
 
167
CREATE TABLE CPG_users (
168
  user_id int(11) NOT NULL auto_increment,
169
  user_group int(11) NOT NULL default '2',
170
  user_active enum('YES','NO') NOT NULL default 'NO',
171
  user_name varchar(25) NOT NULL default '',
172
  user_password varchar(25) NOT NULL default '',
173
  user_lastvisit datetime NOT NULL default '0000-00-00 00:00:00',
174
  user_regdate datetime NOT NULL default '0000-00-00 00:00:00',
175
  user_group_list varchar(255) NOT NULL default '',
176
  user_email varchar(255) NOT NULL default '',
177
  user_website varchar(255) NOT NULL default '',
178
  user_location varchar(255) NOT NULL default '',
179
  user_interests varchar(255) NOT NULL default '',
180
  user_occupation varchar(255) NOT NULL default '',
181
  user_actkey varchar(32) NOT NULL default '',
182
  PRIMARY KEY  (user_id),
183
  UNIQUE KEY user_name (user_name)
184
) TYPE=MyISAM;
185
# --------------------------------------------------------
186
 
187
#
188
# Table structure for table `CPG_votes`
189
#
190
 
191
CREATE TABLE CPG_votes (
192
  pic_id mediumint(9) NOT NULL default '0',
193
  user_md5_id varchar(32) NOT NULL default '',
194
  vote_time int(11) NOT NULL default '0',
195
  PRIMARY KEY  (pic_id,user_md5_id)
196
) TYPE=MyISAM;
197
#---------------------------------------------------------
198
 
199
#
200
# Table structure for table `CPG_banned`
201
#
202
 
203
CREATE TABLE CPG_banned (
204
        ban_id int(11) NOT NULL auto_increment,
205
        user_id int(11) DEFAULT NULL,
206
        ip_addr tinytext DEFAULT NULL,
207
        expiry datetime DEFAULT NULL,
208
        PRIMARY KEY  (ban_id)
209
) TYPE=MyISAM;
210
#---------------------------------------------------------
211
 
212
#
213
# Table structure for table `CPG_exif`
214
#
215
 
216
CREATE TABLE CPG_exif (
217
  `filename` varchar(255) NOT NULL default '',
218
  `exifData` text NOT NULL,
219
  UNIQUE KEY `filename` (`filename`)
220
) TYPE=MyISAM;
221
# --------------------------------------------------------
222
 
223
#
224
# Table structure for table `CPG_filetypes`
225
#
226
 
227
CREATE TABLE IF NOT EXISTS CPG_filetypes (
228
  extension char(7) NOT NULL default '',
229
  mime char(30) default NULL,
230
  content char(15) default NULL,
231
  PRIMARY KEY (extension)
232
) TYPE=MyISAM COMMENT='Used to store the file extensions';
233
 
234
 
235
#
236
# Table structure for table `CPG_ecards`
237
#
238
 
239
CREATE TABLE CPG_ecards (
240
  eid int(11) NOT NULL auto_increment,
241
  sender_name varchar(50) NOT NULL default '',
242
  sender_email text NOT NULL,
243
  recipient_name varchar(50) NOT NULL default '',
244
  recipient_email text NOT NULL,
245
  link text NOT NULL,
246
  date tinytext NOT NULL,
247
  sender_ip tinytext NOT NULL,
248
  PRIMARY KEY  (eid)
249
) TYPE=MyISAM COMMENT='Used to log ecards';
250
 
251
 
252
 
253
#
254
# Table structure for table `CPG_temp_data`
255
#
256
 
257
CREATE TABLE IF NOT EXISTS `CPG_temp_data` (
258
`unique_ID` CHAR( 8 ) NOT NULL ,
259
`encoded_string` BLOB NOT NULL ,
260
`timestamp` INT( 11 ) UNSIGNED NOT NULL ,
261
PRIMARY KEY ( `unique_ID` )
262
) TYPE = MYISAM COMMENT = 'Holds temporary file data for multiple file uploads';