﻿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
28920	AlterModelManagers migration is generated for all Models with custom Managers, which is not compatible with Django 1.8	Michał Bońkowski	nobody	"We have a Model and a `default_manager` with a custom name:

{{{
class MyModel(models.Model):
    my_objects = models.Manager()
}}}

This creates a migration with a default manager though no manager is marked with use_in_migrations = True.
{{{
class Migration(migrations.Migration):

    operations = [
        migrations.CreateModel(
            name='MyModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'default_manager_name': 'my_objects',
            },
            managers=[
                ('my_objects', django.db.models.manager.Manager()),
            ],
        ),
    ]
}}}
According to [https://code.djangoproject.com/ticket/26643#comment:5], we should not get this manager added to the state.

After some investigation, we can see that manager with any other name than `objects` will be added to the migration: [https://github.com/django/django/blob/1.11.8/django/db/migrations/state.py#L537].

Edit:
Under Django 1.8 makemigrations does not create a migration, while in Django 1.11 it creates one.
"	Uncategorized	new	Uncategorized	1.11	Normal				Unreviewed	0	0	0	0	0	0
