﻿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
27885	Migration creates index of a deleted table	ihucos	nobody	"


If we create a model in a migration with an indexed field, then delete that model, migrations will still try to create the index on a nonexistent table.

That scenario occurred after squashing migrations.

Happened on Django 1.8.13

Example Migration that reproduces this:


{{{
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('bookoya', '0085_auto_20170214_1425'),
    ]

    operations = [
        migrations.CreateModel(
            name='MyModel',
            fields=[
                ('name', models.CharField(max_length=100, unique=True, serialize=False, primary_key=True, db_index=True)),
            ],
        ),

        migrations.DeleteModel(
            name='MyModel',
        ),
    ]
}}}


"	Uncategorized	new	Migrations	1.8	Normal				Unreviewed	0	0	0	0	0	0
