Hello; I have a model with a CharField which is used as primary key:
class MyModel( Model ): string_id = CharField("StringID" , primary_key = True ) I would now like to migrate this model to have a normal integer AutoField as primary key, and the string_id field should just be a unique string: class MyModel( Model ): int_id = AutoField( primary_key = True ) string_id = CharField( "StringID", unique = True ) I have tried several ways of doing this, but it either fails in the 'makemigrations' step, or when I try to apply the migration. Any tips? Joakim -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/338750fb-7b7c-444c-a920-50b018e2a3a6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.