Multiple column primary key as foreign key

  • Frans Kunst
    Frans Kunst

    I have a table with a foreign key constraint that consists of two fields that are a combined primary key in the target table.

    Unfortunately in Editor there is no dropdown for these fields when inserting a record as is the case for single field foreign keys.

    How difficult would it be to extend Editor with this functionality?


  • Jakub Vrána
    Jakub Vrána

    I think that it should be doable with medium difficulty. You have to hide one field and display dropdown based on both fields in the other field. After sending the form, you have to expand the passed value (e.g. from "3-5" to 3 in one field and 5 in the other). I suppose that the columns are numeric - character columns will be more difficult as you would have to escape the separator.

    I am not going to implement this.