ManyToManyField "table exist" error on syncdb

Posted by Derek Reynolds on Stack Overflow See other posts from Stack Overflow or by Derek Reynolds
Published on 2010-03-30T01:56:00Z Indexed on 2010/03/30 5:43 UTC
Read the original article Hit count: 449

When I include a ModelToModelField to one of my models the following error is thrown.

Traceback (most recent call last):
File "manage.py", line 11, in <module>
    execute_manager(settings)
File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 362, in execute_manager
    utility.execute()
File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 303, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 195, in run_from_argv
    self.execute(*args, **options.__dict__)
File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 222, in execute
    output = self.handle(*args, **options)
File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
File "/Library/Python/2.6/site-packages/django/core/management/commands/syncdb.py", line 93, in handle_noargs
    cursor.execute(statement)
File "/Library/Python/2.6/site-packages/django/db/backends/util.py", line 19, in execute
    return self.cursor.execute(sql, params)
File "/Library/Python/2.6/site-packages/django/db/backends/mysql/base.py", line 84, in execute
    return self.cursor.execute(query, args)
File "build/bdist.macosx-10.6-universal/egg/MySQLdb/cursors.py", line 173, in execute
File "build/bdist.macosx-10.6-universal/egg/MySQLdb/connections.py", line 36, in defaulterrorhandler
_mysql_exceptions.OperationalError: (1050, "Table 'orders_proof_approved_associations' already exists")

Field definition:

approved_associations = models.ManyToManyField(Association)

Everything works fine when I remove the field, and the table is no where in site.

Any thoughts as to why this would happen?

© Stack Overflow or respective owner

Related posts about django

Related posts about many-to-many