In ticket #8576 a request was made to remove the restriction that AutoFields must be primary keys so that multiple AutoFields could be used in a model. In MySQL multiple auto-increment fields does not make sense and probably does not make sense in any other database. However, I do think the case can be made to remove the primary key restriction on AutoFields.
First, this restriction is not there in the database. Auto-increment fields do not have to be primary keys. Imposing this restriction could cause a problem when trying to use legacy tables in a Django environment. Is there a compelling reason for Django to impose this restriction? Second, is the use case where the primary key is not an AutoField but the record insert order needs to be tracked. For instance, if the primary key is a phone number or UUIDField it would be useful to also have an AutoField so that records can be sorted in the order they were inserted into the table. This is a real world problem I am faced with right now. Thanks! Andy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
