How to migrate from custom primary key to default id [duplicate]
问题 This question already has answers here : What is the best approach to change primary keys in an existing Django app? (8 answers) Closed 23 days ago . I have created a model with email address as custom primary key as follows: email = models.EmailField(max_length=255, primary_key=True,) Now I realized that this is not a good idea in my case and I would like to go back to the automatically generated id field as primary key. How to do this? I tried this in different ways but all failed. I am