I just created a proxy model and was surprised that manage.py makemigrations
creates a new migration file with a migrations.CreateModel
operation.
A proxy model does not create a new database table, it's just a different python interface to the same dataset and indeed manage.py sqlmigrate my_app_label 0042
returns nothing.
I thought that it might be used to create the proxy model ContentType
but those are created on demand if they don't exist.
Is it used to trigger the creation of the proxy model permissions? There's a 6 year old open bug on proxy model permissions so I'm not really sure how this part is supposed to work now...
It used Django 1.8
to test this.
Edit: to clarify, Django
creates a migration that does nothing for new proxy models so wouldn't we want Django
to not create the migration in the first place if it's of no use?
Is there a use case where it would be useful to have the migration?