On 23 oct, 19:53, cwurld <[EMAIL PROTECTED]> wrote:
> Hi,
(snip)
>
> When I run syncdb, the table is created (I can see it with MySQL
> Admin), but I get the following error:
>
> ----------------------------------------------------------------------------------------------------
> C:\Documents and Settings\CCM\Desktop\pldev>python manage.py syncdb
> Creating table medical_xyzcontent
> Traceback (most recent call last):
(snip)
>   File "C:\Python24\lib\site-packages\MySQLdb\connections.py", line
> 35, in defaulterrorhandler
>     raise errorclass, errorvalue
> _mysql_exceptions.OperationalError: (1005, "Can't create table '.\
> \cwurld_pldev\
> \#sql-f1c_3b.frm' (errno: 150)")
> -----------------------------------------------------------------------------------------------------------
>
> Here is the sql generated by the model:
>
> BEGIN;
> CREATE TABLE `content_algoxxx` (
>     `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
>     `name` varchar(256) NOT NULL,
>     `disease_id` integer NOT NULL
> )
> ;
> ALTER TABLE `content_algoxxx` ADD CONSTRAINT
> disease_id_refs_id_5c05e27d FOREIGN
>  KEY (`disease_id`) REFERENCES `medical_medicalbranch` (`id`);
> COMMIT;
>
> I do not know if it matters, but the old table that is being
> referenced is MyISAM, while the newly created table that contains the
> reference is InnoDB.

Not a MySQL expert (IOW : you'd better check it in MySQL manual), but
I bet this the cause of your problem. IIRC, there's a simple way to
convert a MyISAM table to InnoDB:

ALTER TABLE <tablename> ENGINE=INNODB;

(NB : not tested)



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to