Django migration with uuid field generates duplicated values
<p>I have a <code>uuid</code> field (not a primary key). The generated migration is:</p>

<pre><code>from __future__ import unicode_literals

from django.db import migrations, models
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ....
    ]

    operations = [
        ...
        migrations.AddField(
            model_name='device',
            name='uuid',
            field=models.UUIDField(default=uuid.uuid4, unique=True),
        ),
        ...
    ]
</code></pre>

<p>But when doing <code>python manage.py migrate</code> it is crashing with:</p>

<blockquote>
  <p>django.db.utils.IntegrityError: could not create unique index
  "restaurants_device_uuid_key" DETAIL:  Key
  (uuid)=(f3858ded-b8e0-4ac0-8436-8a61b10efc73) is duplicated.</p>
</blockquote>

<p>Strangely enough, the problem does not seem to occur with primary keys (which are maybe created by the database, and not internally by django?)</p>

<p>How can I add a uuid field, and make sure that migrations work?</p>