1

I'm following this very good advice of transferring models. I've made a mistake and I want to perform a backwards migration. And I'm stuck.

In the backwards migration I'm changing a foreign key constraint with the following line:

db.alter_column('lab_scan', 'raw_file_id',
  self.gf('django.db.models.fields.related.ForeignKey')(to=orm['lab.File']), null=True)

South complains that The model 'file' from the app 'lab' is not available in this migration.

The models dictionary, with the frozen models, does in fact contain an entry for lab.file. So I can't figure out what's wrong.

I tried using orm['lab.file'] (with a lowercase f), just in case, and it improve matters.

UPDATE: Turns out orm.models is empty, even though my migration's models is not.

Community
  • 1
  • 1
zmbq
  • 35,452
  • 13
  • 80
  • 153

0 Answers0