mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #8317 -- Corrected the inspectdb management command to properly set primary_key=True and unique=True on foreign keys. Thanks to bthomas for the report and patch, and to David Gouldin for the tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17451 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -6,3 +6,12 @@ class People(models.Model):
|
||||
|
||||
class Message(models.Model):
|
||||
from_field = models.ForeignKey(People, db_column='from_id')
|
||||
|
||||
class PeopleData(models.Model):
|
||||
people_pk = models.ForeignKey(People, primary_key=True)
|
||||
ssn = models.CharField(max_length=11)
|
||||
|
||||
class PeopleMoreData(models.Model):
|
||||
people_unique = models.ForeignKey(People, unique=True)
|
||||
license = models.CharField(max_length=255)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user