First, in trying to create the migration.
{{{
# django/django/db/migrations/operations/models.py, line 251
# This fails
return "Alter %s for %s (%s constraint(s))" % (self.option_name,
self.name, len(self.unique_together))
# Should be
return "Alter %s for %s (%s constraint(s))" % (self.option_name,
self.name, len(self.unique_together) if self.unique_together is not None
else 0)
}}}
Second, in trying to *run* the migration (if you fix the first issue or
manually create a migration.
{{{
# django/django/db/migrations/state.py, line 276
# This fails
meta_contents["unique_together"] = list(meta_contents["unique_together"])
# Should be
meta_contents["unique_together"] = list(meta_contents["unique_together"])
if meta_contents["unique_together"] is not None else None
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23013>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* has_patch: 0 => 1
* needs_docs: => 0
* needs_tests: => 1
* stage: Unreviewed => Accepted
Comment:
Will try to finish tomorrow if no one beats me to it.
--
Ticket URL: <https://code.djangoproject.com/ticket/23013#comment:1>
* owner: nobody => timo
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/23013#comment:2>
* needs_tests: 1 => 0
Comment:
[https://github.com/django/django/pull/2915 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/23013#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"015496539247b24c73b163f279ae8c8d3ccefc4c"]:
{{{
#!CommitTicketReference repository=""
revision="015496539247b24c73b163f279ae8c8d3ccefc4c"
Fixed #23013 -- Fixed removing unique_together/index_together constraints
in migrations.
Thanks melinath for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23013#comment:4>
Comment (by Tim Graham <timograham@…>):
In [changeset:"01515ebaa45a7facc6b450f3fea77dcdbec85887"]:
{{{
#!CommitTicketReference repository=""
revision="01515ebaa45a7facc6b450f3fea77dcdbec85887"
[1.7.x] Fixed #23013 -- Fixed removing unique_together/index_together
constraints in migrations.
Thanks melinath for the report.
Backport of 0154965392 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23013#comment:5>