#30691: Change uuid field to FK does not create dependency
----------------------------+------------------------------------
Reporter: Dart | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: UUID, FK | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+------------------------------------
Changes (by Carlton Gibson):
* version: 2.2 => master
* component: Uncategorized => Migrations
* stage: Unreviewed => Accepted
Comment:
There's a lot of history in here, so it may turn out this is a duplicate,
but I'll accept this for now, as there's certainly a bug.
`makemigrations` generats this:
{{{
dependencies = [
('testapp1', '0002_app1_another_app'),
]
operations = [
migrations.AlterField(
model_name='app1',
name='another_app',
field=models.ForeignKey(blank=True, null=True,
on_delete=django.db.models.deletion.SET_NULL, to='testapp2.App2',
verbose_name='another app'),
),
]
}}}
But that gives the `ValueError` as you say.
Adjusting `dependencies` allows the test to pass:
{{{
dependencies = [
('testapp1', '0002_app1_another_app'),
('testapp2', '0001_initial'),
]
}}}
Thus, `AlterField` should pick this up.
(Note for later: SQLite raised will required disabling constraint
checking, ref #30023.)
--
Ticket URL: <https://code.djangoproject.com/ticket/30691#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.ef8d84628790e8cdad0bc5dd4fafa695%40djangoproject.com.