#919 (ok 4.3) multiple-column foreign key relation

Next_release
fixed
1
2014-12-05
2006-05-19
valamarth
No

It seems impossible to insert a foreing key relation
with multiple columns by the relation interface.
In practical from the interface it is impossible to
have the equivalent of the SQL:

ALTER TABLE `locktable`
ADD CONSTRAINT `locktable_ibfk_1` FOREIGN KEY
(`axoid`, `version`) REFERENCES `versionhistory`
(`axoid`, `version`);

since the interface generates:

ALTER TABLE `locktable`
ADD CONSTRAINT `locktable_ibfk_1` FOREIGN KEY
(`axoid`) REFERENCES `versionhistory` (`axoid`),
ADD CONSTRAINT `locktable_ibfk_2` FOREIGN KEY
(`version`) REFERENCES `versionhistory` (`version`);

Is it possible to add this (for me) useful operation?

Valamath (Fabrizio)

Discussion

  • liron23

    liron23 - 2006-06-17

    Logged In: YES
    user_id=1541535

    It is useful for me too, because of serveral webpages run
    on the same app

     
  • Marc Delisle

    Marc Delisle - 2006-12-31
    • summary: foreing key relation --> multiple-field foreign key relation
     
  • Marc Delisle

    Marc Delisle - 2006-12-31

    Logged In: YES
    user_id=210714
    Originator: NO

    Do you have any idea on how to present this feature on the relation view?

    Note: in 2.10 we have a new Designer module to create visually the relations, and currently it does not support multiple fields in a relation.

     
  • Marc Delisle

    Marc Delisle - 2013-11-12
    • summary: multiple-field foreign key relation --> multiple-column foreign key relation
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,5 +1,5 @@
     It seems impossible to insert a foreing key relation
    -with multiple fields by the relation interface.
    +with multiple columns by the relation interface.
     In practical  from the interface it is impossible to
     have the equivalent of the SQL:
    
    • Group: --> Needs_decision
     
  • Hugues Peccatte

    Hugues Peccatte - 2013-11-16

    Hi,

    There are problems when:
    - a field is a FK to many other fields;
    - a FK is composed of several fields.

    Maybe the screen could look like this (see attachment).
    A new field in the header could allow to name the FK (I believe that's not possible currently).

     
  • Marc Delisle

    Marc Delisle - 2013-12-05
    • labels: Interface Improvements --> Interface Improvements, GSOC 2014
    • assigned_to: Marc Delisle
     
  • Ashutosh Dhundhara

    Hello Marc,
    can the "Relation View" interface be like as in image below ?

     
  • Marc Delisle

    Marc Delisle - 2014-03-19

    Hi Ashutosh,
    this is a good start but I guess that with your suggestion, there would be a limit of two columns involved?

     
  • Ashutosh Dhundhara

    No no. Actually I took 2 columns just for example.
    Number of columns will be as per in the table.

     
  • Marc Delisle

    Marc Delisle - 2014-08-14
    • summary: multiple-column foreign key relation --> (ok 4.3) multiple-column foreign key relation
    • status: open --> resolved
    • Group: Needs_decision --> Next_release
    • Priority: 5 --> 1
     
  • Marc Delisle

    Marc Delisle - 2014-12-05
    • Status: resolved --> fixed