Set model's TextChoices to a MySQL's ENUM

class TypesOfMedical(models.TextChoices):
    Hospital = 'Hospital', _('Hospital')
    Clinic = 'Clinic', _('Clinic')
    Pharmacy = 'Pharmacy', _('Pharmacy')

class Medical(models.Model):
    name = models.CharField(max_length=250)
    type = models.CharField(

But this set the MySQL table column’s type as varchar(20) instead of ENUM('Hospital','Clinic','Pharmacy') - why is this so ?
Wouldn’t SQL search be faster if its an ENUM of n types instead of a text search ? Maybe not, but I feel a MySQL structure is more understandable than text.

You can check some reasons for this decision in Simon’s comment, there is also a separate ticket for adding EnumField:

If you want to use the enum datatype you can use EnumField provided by a 3rd-party package django-mysql, see

1 Like