I have a django model to which I would like to add a UUIDField :
uuid = models.UUIDField(
default = uuid.uuid4,
unique = True,
editable = False
)
I'd like this uuid to be unique, however at migration of an existing database, I have the following error :
django.db.utils.IntegrityError: (1062, "Duplicate entry '3ba46cb5f7f340ffa43e348cb789901a' for key 'carbon.uuid'")
How can I provide to default an other uuid if this one is already used ?