1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #21236 -- Allowed migrations to work with unique_together tuples.

Thanks hjwp for the report.
This commit is contained in:
Javed Khan
2013-10-07 13:07:35 +05:30
committed by Tim Graham
parent 67f5dffbec
commit 4dbd95ad65
3 changed files with 17 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
from .base import Operation
from django.db import models, router
from django.db.models.options import normalize_unique_together
from django.db.migrations.state import ModelState
@@ -108,6 +109,7 @@ class AlterUniqueTogether(Operation):
def __init__(self, name, unique_together):
self.name = name
unique_together = normalize_unique_together(unique_together)
self.unique_together = set(tuple(cons) for cons in unique_together)
def state_forwards(self, app_label, state):