Ticket #280 (closed defect: fixed)

Opened 6 years ago

Last modified 4 years ago

Removing a OneToOneField Tries to add ID before before removing old PK

Reported by: ed@… Owned by: andrew
Priority: minor Milestone: 0.7
Component: commands Version: 0.6.2
Keywords: OneToOneField, postgres Cc:


If you remove a OneToOneField? from a model, postgres produces the following error:

File "c:\projects\wpf\eggs\django-1.0.2_final-py2.6.egg\django\db\backends\util.py", line 19, in execute
    return self.cursor.execute(sql, params)
psycopg2.ProgrammingError: multiple primary keys for table "edu_core_address" are not allowed

Workaround is to change the order in the migration and move the drop of the old PK before the add of the new PK (id).

Change History

comment:1 Changed 6 years ago by andrew

  • Status changed from new to assigned
  • Milestone set to 0.7

Yes, this is one of the general issues with the ordering of stuff in startmigration. We're reworking it in 0.7, so assigning it there.

comment:2 Changed 6 years ago by andrew

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

South 0.7 now always puts field deletions first, so this bug is solved.

Note: See TracTickets for help on using tickets.