Garfonzo
Garfonzo

Reputation: 3966

Django South Migration introspect_test

I'm trying to do a simple migrate and I'm getting the error

django.db.utils.DatabaseError: (1050, "Table 'introspect_test' already exists").

When looking at the actual MySQL database, I see no table called introspect_test nor do I have such a table defined in any Django model. A little bit of Google-Fu tells me that this introspect_test has something to do with foreign key constraints and South's error checking... or something.

I think this whole problem originated form my own error - while in the middle of executing a python manage.py migrate app_name I accidently hit CTRL-C and, thus, stopped the process.

I guess the question is: how do I get rid of this mysterious introspect_test so that I can migrate normally?

Thanks

Upvotes: 1

Views: 651

Answers (1)

Garfonzo
Garfonzo

Reputation: 3966

Ugh, silly me... what I didn't realise is that the table introspect_test is alls caps and, thus, isn't sorted alphabetically. It turns out that, due to a small laptop screen, doing show tables; listed all the tables but cut off the top few. Since the table in question is labelled as INTROSPECT_TEST it is at the top.

I did a quick drop table INTROSPECT_TEST and then migrated normally.

Fixed.

Upvotes: 1

Related Questions