The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
MyChenQL, part 6
...while making a table in PMA:
Code:
Error SQL-query : CREATE TABLE `settings` ( `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT, `varname` VARCHAR( 255 ) NOT NULL , `prettyname` VARCHAR( 255 ) NOT NULL , `description` TEXT NOT NULL , `isboolean` TINYINT( 1 ) UNSIGNED NOT NULL , `value` TEXT NOT NULL , PRIMARY KEY ( `id` ) , UNIQUE ( `varname` , `prettyname` ) ) MySQL said: Specified key was too long. Max key length is 500 |
#2
|
||||
|
||||
???
change int(11) into int (10)... maybe that's the reason why vb always use int 10 |
#3
|
|||
|
|||
I've made all the other tables in my database have int(11) for the project I'm working on with the exact same attributes (primary auto_increment unsigned) and they work.
|
#4
|
||||
|
||||
hmm, maybe the length of all keys summed up is to long...
try to shorten varname to varchar(200) and retry |
#5
|
|||
|
|||
Nope, not the problem either; all the other tables are using 255, too.
Code:
mysql> describe posts; +--------------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+------------------+------+-----+---------+----------------+ | id | int(11) unsigned | | PRI | NULL | auto_increment | | subject | varchar(255) | | | | | | contents | text | | | | | | threadid | int(11) | | UNI | 0 | | | datetime | int(11) | | | 0 | | | posteruserid | int(11) | | | 0 | | +--------------+------------------+------+-----+---------+----------------+ 6 rows in set (0.00 sec) |
#6
|
||||
|
||||
yeah but you forgot, there the subject is not a unique key, in your query above varname is a unique key
just try out to change it, we will see if i'm right or not |
#7
|
|||
|
|||
Well what I did was remove UNIQUE for the two columns and it worked. I don't understand why it wouldn't allow two unique columns though, I mean what I want is no two identical varnames and no two identical prettynames...
|
#8
|
|||
|
|||
Pfft, making them unique after creating the table worked. I wonder if it's a MySQL bug or something; a though occurs: 255 + 255 > 500 so maybe that's what it was griping about.
*is completely confused* |
#9
|
||||
|
||||
hmm, i think i've said that above?
Quote:
|
#10
|
|||
|
|||
Meh, for now I'll just make it 255 in the install script and then make them unique right after creating the table
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|