Let's assume I have this models structure:
class User(AbstractUser):
first_name = models.CharField(max_length=40, blank=True)
last_name = models.CharField(max_length=40, blank=True)
class UserProfile(models.Model):
uuid = models.UUIDField(unique=True, null=False, default=uuid4)
user = models.OneToOneField(User)
I would like to merge UserProfile into User model, like this:
class User(AbstractUser):
first_name = models.CharField(max_length=40, blank=True)
last_name = models.CharField(max_length=40, blank=True)
uuid = models.UUIDField(unique=True, null=False, default=uuid4)
Most important thing is to migrate existing uuid
from UserProfile
model to new User.uuid
(unique) field. How should that be managed in django > 1.7 migrations ?