This happens when a different field was marked as primary key with primary_key=True earlier and you are removing that (in case of which django tries to add an id primary key).
That Django is asking for a default value for a primary key seems to be a bug.
To work around this problem, follow these steps:
-
Supply a random default value when prompted during makemigrations.
-
Go to the migration file generated (under
your_app\migrations\and delete thedefault=x,, x being the random value you supplied in step 1. -
While you are at the migration file, make sure the order of actions make sense (e.g., remove/alter one primary key before adding another). Save and close.
-
Migrate as usual.