Modify ↓
Ticket #280 (closed defect: fixed)
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: |
Description
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).
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

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.