﻿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
26752	RenameModel requires camel case model names	Neil Parsons	nobody	"The `migrations.RenameModel` class appears to accept all lowercase model names but when the `makemigrations` command is run afterwards it will generate an `AlterField` migration every time. This occurs when there exists a model that has a `ForeignKey` that relies on the renamed model.

When the model names are changed to camel case the `makemigrations` command works as expected and no longer generates `AlterField` migrations.

Migration that will cause the error case:
{{{
migrations.RenameModel(
    old_name='originalmodel',  # Note: Not using CamelCase!
    new_name='renamedmodel',
),
}}}

The generated migration in the error case:
{{{
migrations.AlterField(
    model_name='anothermodel',
    name='foreign_key_field',
    field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='an_app.RenamedModel'),
),
}}}

This behaviour can be seen in this demo project: https://github.com/npars/django-bad-migrations"	Bug	closed	Migrations	1.9	Normal	duplicate			Unreviewed	0	0	0	0	0	0
