Hi all,
I am getting this error when running "./manage.py migrate app_name"
While loading migration 'whatever.0001_initial':
Traceback (most recent call last):
File "manage.py", line 14, in <module> execute_manager(settings)
...tons of other stuff..
raise KeyError("The model '%s' from the app '%s' is not available in this migration." % (model, app))
KeyError: "The model 'appuser' from the app 'whatever' is not available in this migration."
I am sure that model "appuser" is both in application models.py and in 0001_initial.py
AppUser model from models.py:
class AppUser(models.Model):
person = models.OneToOneField('Person')
user = models.ForeignKey(User, unique=True)
class Meta:
permissions = (
('is_one', 'one'),
('is_two', 'two')
)
def __unicode__(self):
return self.person.__unicode__()
AppUser model from 0001_initial.py:
# Adding model 'AppUser'
db.create_table('app_appuser', (
('person', models.OneToOneField(orm.Person)),
('id', models.AutoField(primary_key=True)),
('user', models.ForeignKey(orm['auth.User'], unique=True)),
))
db.send_create_signal('app', ['AppUser'])
...
'app.appuser': {
'Meta': {'permissions': "(('is_one','one'),('is_two','two'))"},
'id': ('models.AutoField', [], {'primary_key': 'True'}),
'person': ('models.OneToOneField', ["'Person'"], {}),
'user': ('models.ForeignKey', ['User'], {'unique': 'True'})
},
I am trying to run it on empty database (ie. no "app_*" tables) like that:
manage.py migrate app
This seem to be happening only on python 2.5 on Mac OS, no probs with Ubuntu/python 2.6
Question - how to fix?
Thanks!