#33187: Foreign key to a specific field is not handled in inspected
-------------------------------------------+------------------------
               Reporter:  Thierry Bastian  |          Owner:  nobody
                   Type:  Uncategorized    |         Status:  new
              Component:  Uncategorized    |        Version:  3.2
               Severity:  Normal           |       Keywords:
           Triage Stage:  Unreviewed       |      Has patch:  1
    Needs documentation:  0                |    Needs tests:  0
Patch needs improvement:  0                |  Easy pickings:  0
                  UI/UX:  0                |
-------------------------------------------+------------------------
 if you have a DB like that

 CREATE TABLE foo ( id serial primary key, other_id int UNIQUE);

 CREATE TABLE bar ( id serial primary key, other_id int,
 constraint myconst
                                                                    FOREIGN
 KEY(other_id) references foo(other_id)
                                                                   );


 the generated model for the bar table will have the other_id be a FK to
 foo and not foo(other_id).

 I'm attaching a potential fix for this. Sorry I had no time for the UTs.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33187>
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/052.ea2a9ab21fd32096fc290e962071273a%40djangoproject.com.

Reply via email to