When using SQLExpress and trying to modify the primary key used in a class to a UUID the migration fails.
class Cart(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
id = models.UUIDField(primary_key=True,default=uuid4)
Added the id field
id = models.UUIDField(primary_key=True,default=uuid4)
Created the migration.
When I applied the migration VS Code raised an exception:
raise NotImplementedError(“the backend doesn’t support altering from %s to %s.” %
NotImplementedError: the backend doesn’t support altering from BigAutoField to UUIDField.
My searches are not finding a workaround for this configuration. I’ve tried directly changing the field type in the DB. Other suggestions?