MySQL Forums
Forum List  »  MySQL Query Browser

Re: contraint foreign key?
Posted by: Michael G. Zinner
Date: June 27, 2005 07:11AM

You have one ( too much in the tex_name table create statement.

DROP TABLE IF EXISTS `tex_type`;
CREATE TABLE `tex_type` (
`tex_type_id` int(10) unsigned NOT NULL auto_increment,
`tex_type_name` varchar(255) NOT NULL default '',
PRIMARY KEY (`tex_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `tex_name`;
CREATE TABLE `tex_name` (
`tex_name_id` int(10) unsigned NOT NULL auto_increment,
`tex_type_id` int(10) unsigned NOT NULL default '0',
`tex_name_name` varchar(255) NOT NULL default '',
PRIMARY KEY (`tex_name_id`),
KEY `FK_tex_name_1` (`tex_type_id`),
CONSTRAINT `FK_tex_name_1` FOREIGN KEY (`tex_type_id`) REFERENCES `tex_type` (`tex_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

This works for me when executed on a script tabsheet (Ctrl+Shift+T) in QB. And it also shows the FK definition in the table editor. Take a look:

http://forums.mysql.com/file.php?108,file=1

Mike

Michael Zinner, Team Lead, Developer Tools
MySQL AB, www.mysql.com

Are you MySQL certified? www.mysql.com/certification

Options: ReplyQuote


Subject
Written By
Posted
June 20, 2005 09:46PM
June 27, 2005 04:22AM
Re: contraint foreign key?
June 27, 2005 07:11AM
June 29, 2005 07:28PM
July 02, 2005 12:50AM
July 04, 2005 08:18PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.