Opened 9 years ago
Last modified 9 years ago
#27885 closed Bug
Migration creates index of a deleted table — at Initial Version
| Reported by: | ihucos | Owned by: | nobody |
|---|---|---|---|
| Component: | Migrations | Version: | 1.8 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
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',
),
]
Note:
See TracTickets
for help on using tickets.