Ticket #97 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

Problem creating migration when removing model which has one-to-one relationship

Reported by: bendavis78@… Owned by: andrew
Priority: major Milestone: 0.5
Component: commands Version: 0.6-pre
Keywords: Cc:


Old models.py (frozen in last migration):

class FooModel(models.Model):
    somefield = models.IntegerField()

class BarModel(models.Model):
    blahfield = models.IntegerField()
    myfoo = models.OneToOneField(FooModel, blank=True,null=True)

new models.py

class BarModel(models.Model):
    blafield = models.IntegerField()

startmigration output

$ ./manage.py startmigration testapp test --auto
Traceback (most recent call last):
  File "./manage.py", line 11, in <module>
  File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 350, in execute_manager
  File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 295, in execute
  File "/usr/lib/python2.5/site-packages/django/core/management/base.py", line 195, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.5/site-packages/django/core/management/base.py", line 222, in execute
    output = self.handle(*args, **options)
  File "/home/ben/Projects/southtest/south/management/commands/startmigration.py", line 245, in handle
  File "/usr/lib/python2.5/site-packages/django/db/models/options.py", line 285, in get_field_by_name
    % (self.object_name, name))
django.db.models.fields.FieldDoesNotExist: barmodel has no field named 'myfoo'

Change History

comment:1 Changed 7 years ago by andrew

  • Status changed from new to closed
  • Resolution set to fixed

Oh, the joys of what I found here. Should be fixed in [172], along with other bugs fixing this one made me find.

comment:2 Changed 7 years ago by andrew

  • Milestone set to 0.5
Note: See TracTickets for help on using tickets.