﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29987	Deleting non-managed model does not generate a DeleteModel in migrations	Daniel Bowring	Tim Fiedler	"If you have a model like:

{{{
class NonManagedModel(models.Model):
    some_field = models.TextField()

    class Meta:
        managed = False
}}}

and run `makemigrations`, a migration including a `CreateModel` will be generated

{{{
$ python3 manage.py makemigrations nmapp
Migrations for 'nmapp':
  nmapp/migrations/0001_initial.py
    - Create model NonManagedModel
}}}

However, if you remove the model from `models.py`, no migration with a `DeleteModel` is created

{{{
$ python3 manage.py makemigrations nmapp
No changes detected in app 'nmapp'
}}}

It seems like the intention was to include this for unmanaged models, but is being skipped (see [https://github.com/django/django/blob/d6226e3a821a5132c61233c8df767810ce00f851/django/db/migrations/autodetector.py#L701 django.db.migrations.autodetector]) "	Bug	closed	Migrations	2.1	Normal	fixed	autodetector managed model delete		Accepted	1	0	0	0	0	0
