intermediate table in manytomany relationship not created

2010-08-05 Thread bksfu
Hi, I have the following model: -- from django.db import models class Phone(models.Model): id = models.AutoField(primary_key=True, db_column='id') type = models.CharField(max_length=1, db_column='Type', null=False, blank=False) status = models.CharField(max_length=1, db_column

Re: intermediate table in manytomany relationship not created

2010-08-05 Thread bksfu
When Django created the above tables, they were created with the MyISAM engine. If the intermediate table has to have foreign keys back to the Phone and Room tables, this would be illegal from MySQL's perspective, which can apparently only form foreign key constraints between InnoDB tables. If th

Re: intermediate table in manytomany relationship not created

2010-08-06 Thread bksfu
enzuela > > On Thu, Aug 5, 2010 at 12:48 PM, bksfu wrote: > > When Django created the above tables, they were created with the > > MyISAM engine.  If the intermediate table has to have foreign keys > > back to the Phone and Room tables, this would be illegal from MySQL's

Django not creating intermediary tables for m2m relations

2010-08-06 Thread bksfu
Hi All, When I run manage.py sqlall test, I get the proper MySQL create statements for my models, (Phone,Room). Room has a ManyToManyField(Phone) field, so I also get the proper intermediate Room_phones table: BEGIN; CREATE TABLE `Phone` ( `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY , bl

Re: Django not creating intermediary tables for m2m relations

2010-08-10 Thread bksfu
Hi Xavier, I had dropped my tables earlier, so this wasn't the problem. Everything was being created afresh, although there were existing tables in the DB that had nothing to do with my models. All my existing tables had different names than the ones in my models. On Aug 7, 2:55 am, Xavier Ordoq