With MySQL, instead of auto-creating the rowid field as done on PostgreSQL, the “slug” field:
slug = models.SlugField(primary_key=True, max_length=128)
is used in JOINs, as the “id” field is not created at DB level. The implications are that when doing JOINs the “slug” FK is used, with string data! Of course this is very expensive compared to JOINs using integers.
How do I have Django creating the db-level ID field on MySQL as automatically happens on PostgreSQL?
You can only have one primary key per table. Since you’ve created one yourself, the ORM does not create one for you.