﻿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
24260	Add migration support for logical field renames	Raymond Penners	nobody	"Suppose you have a legacy model, defined like this:

{{{
    class Foo(models.Model):
        foo_id = models.AutoField(primary_key=True)
}}}

Now, I would like to clean this up, into:

{{{
    class Foo(models.Model):
        id = models.AutoField(primary_key=True, db_column='foo_id')
}}}

This is only a logical name change, without any impact on the
database. Yet, there seems to be no way to convince `makemigrations`
that nothing needs to happen.

Whatever I do, it will always complain, or worse, attempt to remove
the `foo_id` altogether:

{{{
    operations = [
        migrations.RemoveField(
            model_name='foo',
            name='foo_id',
        ),
        migrations.AddField(
            model_name='foo',
            name='id',
            field=models.AutoField(default=0, serialize=False, primary_key=True, db_column=b'foo_id'),
            preserve_default=False,
        ),
    ]
}}}

Using South you could work around this by having empty
forwards/backwards methods.  It would be nice if Django migrations
offered a way out as well."	New feature	closed	Migrations	1.7	Normal	fixed			Accepted	0	0	0	0	0	0
