I have a Django 1.11.10 project with an unmanaged model like:
class MyModel(models.Model):
id = models.PositiveIntegerField(primary_key=True)
name = models.CharField(max_length=500)
class Meta:
managed = False
The model wraps a custom SQL view. However, when I run manage.py makemigrations
, I find that Django tries to generate a migration that creates a traditional SQL table for this model.
In past versions of Django, as this question illustrates, managed = False
used to prevent this. Is this no longer true? How do you get Django to not ignore schema changes on a model?