mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #25274 --- Made inspectdb handle renamed fields in unique_together.
This commit is contained in:
parent
ec202eff84
commit
2cb50f935a
4 changed files with 27 additions and 9 deletions
|
@ -72,6 +72,13 @@ class ColumnTypes(models.Model):
|
|||
class UniqueTogether(models.Model):
|
||||
field1 = models.IntegerField()
|
||||
field2 = models.CharField(max_length=10)
|
||||
from_field = models.IntegerField(db_column='from')
|
||||
non_unique = models.IntegerField(db_column='non__unique_column')
|
||||
non_unique_0 = models.IntegerField(db_column='non_unique__column')
|
||||
|
||||
class Meta:
|
||||
unique_together = ('field1', 'field2')
|
||||
unique_together = [
|
||||
('field1', 'field2'),
|
||||
('from_field', 'field1'),
|
||||
('non_unique', 'non_unique_0'),
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue