Jigal van Hemert wrote:
From: "Philippe Poelvoorde"
[Note,
ALTER TABLE foo ADD userid integer unsigned NOT NULL auto_increment
BEFORE username, ADD PRIMARY KEY(userid);
does not seems to work, possibly a bug ?
]
No, you forgot the DROP PRIMARY KEY ;-)
well not really, that's the statement before ! ;-)
I was thus speaking of :
-- drop the PK
ALTER TABLE foo DROP PRIMARY KEY;
-- add the new one
ALTER TABLE foo ADD userid integer unsigned NOT NULL auto_increment
BEFORE username, ADD PRIMARY KEY(userid);
-- move it to the first column
ALTER TABLE foo MODIFY userid integer unsigned NOT NULL auto_increment
BEFORE username;
which gives me an error for the second query.
So is that normal that I can't specify BEFORE username ?
ALTER TABLE `foo` DROP PRIMARY KEY, ADD `userid` INTEGER UNSIGNED NOT NULL
AUTO_INCREMENT FIRST, ADD PRIMARY KEY(`userid`);
works like a charm (MySQL 4.0.23-standard).
Regards, Jigal.
--
Philippe Poelvoorde
COS Trading Ltd.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]