Michael Bayer wrote:
> Wade Leftwich wrote:
>
>>For MySql 3.23.44 <= version < 4.1.2, the CREATE TABLE statement must
>>explicitly name the foreign key indexes to be created, so as Sqlalchemy
>>now stands the table.create() method will not work with an InnoDB table
>>that has foreign keys.
>
>
>
> The syntax its doing right now is:
>
> CREATE TABLE foo (
> col1 integer primary key,
> col2 integer,
> foreign key (col2) references bar(col1)
> ) engine=InnoDB
>
> it works in my 5.0 installation.... 3/4 no good ? we can make it whatever
> it has to be.
>
>
For MySQL v < 3.23.44 -- forget it, foreign keys are not supported.
For v >= 4.1.2, existing syntax is great.
For 3.23.44 <= v < 4.1.2, I *think* you have to say
CREATE TABLE foo (
col1 integer primary key,
col2 integer,
foreign key col2 (fk_col2_col1) references bar(col1)
) engine=InnoDB
... where 'fk_col2_col1' is an index name, unique identifier in the DB.
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users