UUID fields as primary key failing migration with SQLExpress in The Ultimate Django Series: Part 2

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?

Delete all migrations also delete the database then connect with new database and migrate again

Thank you. That worked. I was a bit nervous about deleting the db and rebuilding it. That said, it was a good exercise.