title: What is the best approach to change primary keys in an existing Django app?
body: <p>I have an application which is in BETA mode. The model of this app has some classes with an explicit primary_key. As a consequence Django use the fields and doesn't create an id automatically.</p>
  
  <pre><code>class Something(models.Model):
      name = models.CharField(max_length=64, primary_key=True)
  </code></pre>
  
  <p>I think that it was a bad idea (see <a href="https://stackoverflow.com/questions/2011629/unicode-error-when-saving-an-object-in-django-admin">unicode error when saving an object in django admin</a>) and I would like to move back and have an id for every class of my model.</p>
  
  <pre><code>class Something(models.Model):
      name = models.CharField(max_length=64, db_index=True)
  </code></pre>
  
  <p>I've made the changes to my model (replace every primary_key=True by db_index=True) and I want to migrate the database with <a href="http://south.aeracode.org/wiki/Tutorial" rel="noreferrer">south</a>.</p>
  
  <p>Unfortunately, the migration fails with the following message:
  <code>ValueError: You cannot add a null=False column without a default value.</code></p>
  
  <p>I am evaluating the different workarounds for this problem. Any suggestions?</p>
  
  <p>Thanks for your help</p>