Patrick,
>Heikki,
> I did end up reading that bit before you sent this to the list, but before I
>could send the follow up I wanted. I have added the creation of the index to
>my create statement, but I get the same error. Here is the sql as it stands
now:
>CREATE TABLE `user` ( `user_id` int(11) NOT NULL auto_increment,
> `username` varchar(30) NOT NULL default '',
> `firstname` varchar(30) NOT NULL default '',
> `lastname` varchar(30) NOT NULL default '',
> `email` varchar(100) NOT NULL default '',
> `password` char(16) NOT NULL default '',
> `admin` char(1) NOT NULL default 'N', PRIMARY KEY (`user_id`),
>
> UNIQUE KEY `username` (`username`)) TYPE=innodbCREATE TABLE `wishlist` (
> `wishlist_id` int(11) NOT NULL auto_increment,
> `user_id` int(11) NOT NULL,
> PRIMARY KEY (`wishlist_id`),
> INDEX `wishlist_user_id_ind` (`user_id`),
> FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`)
> ) TYPE = innodb
sorry, the InnoDB parser does not know the quoted name notation you use for
columns and tables.
Use the following:
CREATE TABLE `wishlist` (
`wishlist_id` int(11) NOT NULL auto_increment,
`user_id` int(11) NOT NULL,
PRIMARY KEY (`wishlist_id`),
INDEX `wishlist_user_id_ind` (`user_id`),
FOREIGN KEY (user_id) REFERENCES user (user_id)
) TYPE = innodb;
That will work. By the way, why do many people write table and column names
in quotes? What is the origin of that convention? Avoiding reserved words?
I may change the InnoDB parser so that it removes quotes from table and
column names when it parses the FOREIGN KEY clause.
>Thanks,
>Patrick
Regards,
Heikki Tuuri
Innobase Oy
---
Order commercial MySQL/InnoDB support at https://order.mysql.com/
See http://www.innodb.com for the online manual and latest news on InnoDB
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php