﻿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
24650	Migration changing db_table and managed not creating new table	Eduardo Klein	nobody	"I had a model like this:

{{{
class Decoupe(models.Model):
    constante = models.IntegerField()

    class Meta:
        managed = False
        db_table = ""Decoupe""
}}}

I ran the first migration and it recognized the options as expected. 
Then I removed the meta options, so the model looked like this:
{{{
class Decoupe(models.Model):
    constante = models.IntegerField()
}}}

I ran make migrations and it created the following:

{{{
migrations.AlterModelOptions(
    name='decoupe',
    options={},
),
}}}

When I applied it, nothing really happened and of course, when, trying from the shell, to to `Decoupe.objects.all()`, I got an error saying that the table ""myapp_decoupe"" did not exits.

I would expect either the table to be renamed or at least created empty.

I tried to workaround this replacing the `migrations` above with
{{{
migrations.DeleteModel(""decoupe""),
migrations.CreateModel( ... ),
}}}
But when I ran it, I got a error: 
`RuntimeError: Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually.`, although the contenttypes is migrated.

Is this a bug or desired behavior since the model was ""managed=False""?

"	Cleanup/optimization	closed	Documentation	1.8	Normal	fixed			Accepted	1	0	0	0	0	0
