Код:
Ошибка
SQL-запрос:
# --------------------------------------------------------
#
# Table structure for table 'cpg_pictures'
#
CREATE TABLE cpg_pictures(
pid int( 11 ) NOT NULL AUTO_INCREMENT ,
aid int( 11 ) DEFAULT '0' NOT NULL ,
filepath varchar( 255 ) NOT NULL ,
filename varchar( 255 ) NOT NULL ,
filesize int( 11 ) DEFAULT '0' NOT NULL ,
total_filesize int( 11 ) DEFAULT '0' NOT NULL ,
pwidth smallint( 6 ) DEFAULT '0' NOT NULL ,
pheight smallint( 6 ) DEFAULT '0' NOT NULL ,
hits int( 10 ) DEFAULT '0' NOT NULL ,
mtime timestamp DEFAULT 'CURRENT_TIMESTAMP',
ctime int( 11 ) DEFAULT '0' NOT NULL ,
owner_id int( 11 ) DEFAULT '0' NOT NULL ,
owner_name varchar( 40 ) NOT NULL ,
pic_rating int( 11 ) DEFAULT '0' NOT NULL ,
votes int( 11 ) DEFAULT '0' NOT NULL ,
title varchar( 255 ) NOT NULL ,
caption text NOT NULL ,
keywords varchar( 255 ) NOT NULL ,
approved enum( 'YES', 'NO' ) DEFAULT 'NO' NOT NULL ,
user1 varchar( 255 ) NOT NULL ,
user2 varchar( 255 ) NOT NULL ,
user3 varchar( 255 ) NOT NULL ,
user4 varchar( 255 ) NOT NULL ,
url_prefix tinyint( 4 ) DEFAULT '0' NOT NULL ,
randpos int( 11 ) DEFAULT '0' NOT NULL ,
pic_raw_ip tinytext,
pic_hdr_ip tinytext,
PRIMARY KEY ( pid ) ,
KEY pic_hits( hits ) ,
KEY pic_rate( pic_rating ) ,
KEY aid_approved( aid, approved ) ,
KEY randpos( randpos ) ,
KEY pic_aid( aid ) ,
KEY search( title, caption, keywords, filename )
)
Ответ MySQL:
#1170 - BLOB/TEXT column 'caption' used in key specification without a key length
"колонны 'заголовка использовалась в ключевой спецификации без ключевой длины"Что я удалил лишнего?
Код:
# --------------------------------------------------------
#
# Table structure for table 'cpg_albums'
#
CREATE TABLE cpg_albums (
aid int(11) NOT NULL auto_increment,
title varchar(255) NOT NULL,
description text NOT NULL,
visibility int(11) DEFAULT '0' NOT NULL,
uploads enum('YES','NO') DEFAULT 'NO' NOT NULL,
comments enum('YES','NO') DEFAULT 'YES' NOT NULL,
votes enum('YES','NO') DEFAULT 'YES' NOT NULL,
pos int(11) DEFAULT '0' NOT NULL,
category int(11) DEFAULT '0' NOT NULL,
pic_count int(11) DEFAULT '0' NOT NULL,
thumb int(11) DEFAULT '0' NOT NULL,
last_addition datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
stat_uptodate enum('YES','NO') DEFAULT 'NO' NOT NULL,
PRIMARY KEY (aid),
KEY alb_category (category)
);
#
# Dumping data for table 'cpg_albums'
#