R
R
Rrooom2014-08-14 16:39:53
linux
Rrooom, 2014-08-14 16:39:53

How to fix south migration error?

KeyError: "The model 'category' from the app 'types' is not available in this migration."
Nothing worthwhile is googled. The last south, like nothing too terrible.
Falls on the line:

self.gf('django.db.models.fields.related.ForeignKey')(to=orm['types.Category'],
                                                                   null=True, blank=True)),

Where the foreignkey is created on the model itself.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yeletsky, 2014-08-15
@Tiendil

When creating a migration, South does not commit the entire database schema, but only the tables associated with the current application. You may be trying to manually add a ForeignKey to a model that this migration does not know about.
Look towards the --freeze option for schemamigration

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question