Menu

#406 (Relations) Multiple merged foreign keys

Needs_planning
wont-fix
nobody
Normal
2015-04-27
2003-11-04
No

If you have a linked table where there can be multiple
entries, then you cannot actually link the two tables
together if you want to add more than one id - the
dropdown list is a single-entry type. Instead could SET
fields pointing at another table have a multiple-choice
list that you can select from (keeping in mind that the
SET values might not include all entries from the
target table).

Discussion

  • Garvin Hicking

    Garvin Hicking - 2003-11-04

    Logged In: YES
    user_id=473563

    Can you please be more verbose/specific in your bug report?

    If you say, that the linked table can have multiple entries:
    Do you mean that you don't have the unique primary key set
    as the 'connecting' factor?

    Please check if your bug report is related to any one of
    those feature requests:

    #551702, #574858, #607812, #650357, #772988, #825505

    Thanks,
    Garvin.

     
  • Anonymous

    Anonymous - 2003-11-04

    Logged In: YES
    user_id=535107

    Checked out those feature requests, although one or two come
    close, they're not quite what I mean.

    Here's an example. tb_person is a list of animals, tb_hair
    is a list of hair types, tb_person->hair is a SET (ie,
    multiple entries) as someone can have "LONG" & "BLOND" hair.
    Rather than putting the entries directly into the SET
    values, have the SET point to the primary key of tb_hair,
    which in turn contains the entries "LONG" and "BLOND".

    For a normal linked table where you can only have a single
    value it works perfectly as the Insert screen allows you to
    select a single entry from a drop-down list. However, in a
    SET type where there may be multiple entries, you still only
    get the single drop-down list, and no way of adding more
    than one entry.

    Instead it should be a normal list, where you can
    toggle-select one or more entries from the target table.

    Is that any help?

     

    Last edit: Marc Delisle 2015-02-11
  • Garvin Hicking

    Garvin Hicking - 2003-11-05

    Logged In: YES
    user_id=473563

    Thanks, now I get it.

    However, this is not the usual 1:1 relation we use for
    primary key associations, and is more a feature request than
    a bug.

    I also think, this somehow doesn't fit into a foreign key
    setup, and I guess InnoDB doesn't provide such foreign keys
    as well, but we'd have to look into that.

    I will move this to Feature Requests and hope, some others
    may elaborate on this; I'm sure I have read of a 1-to-many
    feature request somewhere already...

    Regards,
    Garvin.

     
  • Anonymous

    Anonymous - 2003-11-05

    Logged In: YES
    user_id=535107

    Well, the bug itself is that it's getting the drop-down
    (single-item) list on a SET type, having a multi-select list
    is a feature request though ;-)

     
  • Garvin Hicking

    Garvin Hicking - 2003-11-05

    Logged In: YES
    user_id=473563

    It's not really a bug, that you get the dropdown for a SET
    type. It's rather the whole idea, that we currently only
    support 1-1 relations. And as I mentioned, I don't even know
    if foreign key relations from a fixed SET column are
    possible in MySQL/InnoDB. At least, it screws up your
    relational integrity a lot. :-)

     
  • Marc Delisle

    Marc Delisle - 2015-02-11

    The team is not sure about this, but would appreciate sample tables.

     
    • Marc Delisle

      Marc Delisle - 2015-04-27

      No news, closing.

       
  • Marc Delisle

    Marc Delisle - 2015-04-27
    • status: pending --> wont-fix
     
MongoDB Logo MongoDB