﻿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
24062	Reversing Model names fails!	doepunk	nobody	"I've run into this problem before. When I make a migration renaming a Model and later try to revert to an older migration, it fails. The Model is very simple with no foreign keys or other relationships to or from other Models. It only contains one TextField and one CharacterField with choices. When I try to migrate back after renaming the model, I get the following error

{{{
django.db.migrations.migration.IrreversibleError: Operation <RenameModel  new_name='NewModel', old_name='OldModel'> in <migration-name> is not reversible
}}}

I consider this a bug, because I think renaming a database table to an old name should not result in failure.

Another thing I noticed in that context is that when I originally did the makemigrations to the NewModel name, I was asked if I had renamed, the OldModel, which is great. However when I ran the migrate, I was told this


{{{
The following content types are stale and need to be deleted:

    <app-name> | <old-name>

Any objects related to these content types by a foreign key will also
be deleted. Are you sure you want to delete these content types?
If you're unsure, answer 'no'.
}}}

I'm unsure what's going on here. But shouldn't renaming involve the automatic deletion of the old name and replacing the foreign keys with the new database table keys? All without a need for confirmation. Or at least if there are no foreign keys as in my case, the confirmation seems unnecessary and it only makes it harder to run the migration unsupervised."	Bug	closed	Migrations	1.7	Normal	duplicate			Unreviewed	0	0	0	0	0	0
