10 messages in com.mysql.lists.mysqlRe: How to retrieve constraints and l...
FromSent OnAttachments
Varakorn Ungvichian26 Nov 2004 00:31 
Martijn Tonies26 Nov 2004 05:19 
Mechain Marc26 Nov 2004 05:24 
Martijn Tonies26 Nov 2004 08:30 
Varakorn Ungvichian27 Nov 2004 23:56 
Varakorn Ungvichian28 Nov 2004 00:45 
Martijn Tonies28 Nov 2004 05:53 
Michael Stassen28 Nov 2004 07:11 
Varakorn Ungvichian28 Nov 2004 18:53 
Michael Stassen28 Nov 2004 19:33 
Subject:Re: How to retrieve constraints and links from MySQL tables?
From:Michael Stassen (Mich@verizon.net)
Date:11/28/2004 07:33:26 PM
List:com.mysql.lists.mysql

Varakorn Ungvichian wrote:

--- Michael Stassen <Mich@verizon.net> wrote:

Varakorn Ungvichian wrote:

Just realised something: my table was MyIsam. I switched it to InnoDB (which support FKs), but

now:

1. "Show Create Table" still doesn't show

reference

links, and

Well, of course not. It won't show them until you create them, which you haven't done according to #2.

I'm thinking more along the terms of when I include something like "position_id tinyint(4) NOT NULL default 1 references positions (position_id)" in the "create table" statement.

Which is parsed but silently ignored for non-InnoDB tables <http://dev.mysql.com/doc/mysql/en/CREATE_TABLE.html>, so it won't be there in SHOW CREATE TABLE output. InnoDB tables support this, but you have to have the index(es) in place for it to work. See the manual for more <http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html>.

Varakorn Ungvichian

Michael