Actually, like I said, I tried it on my local config and it worked ok as well! That's why I suspect some MySQL configuration issue but... The only thing I have noticed is the default table format : - InnoDB at home, it works - MyISAM on the server, it fails (it creates InnoDB tables because I ask him to do it in sqlalchemy) But I don't really see why it would fail.
Posting my sqlalchemy code wouldn't be helpful (and it would be a mess! :) ) because it is really a MySQL error... :( On Oct 1, 3:27 pm, Alex K <[EMAIL PROTECTED]> wrote: > Hi Guillaume, > > The issue that you've faced looks strange - I've just tried to execute > your first example causing the error on my 5.0.45 mysql server and > tables were created ok. Can you post the code snippet causing the > error? > > Regards, > Alex > > On 1 окт, 16:59, GustaV <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > I'm experiencing an issue on MySQL (5.0.51a) when sqlalchemy create > > the tables with foreign keys. > > > The SQL issued : > > CREATE TABLE `referenced` ( > > `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY > > ) TYPE = InnoDB; > > > CREATE TABLE `referencing` ( > > `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , > > `f` INT NOT NULL, > > FOREIGN KEY(f) REFERENCES referenced(id) > > ) TYPE = InnoDB; > > > I got an error (#1005 - Can't create table './seed-online/ > > referencing.frm' (errno: 150) )... I solve this when I specify > > explicitly the foreign key being an index (looks like it is the > > "normal" way to do this) > > > CREATE TABLE `referencing` ( > > `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , > > `f` INT NOT NULL, > > INDEX(f), > > FOREIGN KEY(f) REFERENCES referenced(id) > > ) TYPE = InnoDB; > > > But I don't know how to tell sqlalchemy to explicitely set that index. > > On the other hand, at home (using wampserver2.0c, same version of > > MySQL) it works : it looks like the index is set automatically if not > > already set (I red this in the MySQL docs). > > > So I'm looking for either : > > - an option to tell sqlalchemy to set the index explicitely > > - or, the option in MySQL to turn 'on' to have this INDEX > > automatically! > > > Thanks a lot! > > > Guillaume --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---