Fixed #22823 (and partly #22563) - FKs from unmigrated apps breaking state.

Thanks to bendavis78 for the test and diagnostic work.
This commit is contained in:
Andrew Godwin 2014-06-12 10:21:26 -07:00
parent 9980f67154
commit 7b17350a1b
12 changed files with 114 additions and 13 deletions

View file

@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
"Author",
[
("id", models.AutoField(primary_key=True)),
("name", models.CharField(max_length=255)),
("slug", models.SlugField(null=True)),
("age", models.IntegerField(default=0)),
("silly_field", models.BooleanField(default=False)),
],
),
migrations.CreateModel(
"Tribble",
[
("id", models.AutoField(primary_key=True)),
("fluffy", models.BooleanField(default=True)),
],
)
]

View file

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
"OtherAuthor",
[
("id", models.AutoField(primary_key=True)),
("name", models.CharField(max_length=255)),
("slug", models.SlugField(null=True)),
("age", models.IntegerField(default=0)),
("silly_field", models.BooleanField(default=False)),
],
),
]

View file

@ -0,0 +1,12 @@
from django.db import models
class OtherAuthor(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=255)
slug = models.SlugField(null=True)
age = models.IntegerField(default=0)
silly_field = models.BooleanField(default=False)
class Meta:
app_label = "migrated_unapplied_app"

View file

@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
class SillyModel(models.Model):
silly_field = models.BooleanField(default=False)
silly_tribble = models.ForeignKey("migrations.Tribble")
is_trouble = models.BooleanField(default=True)