<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jul 25, 2014 at 8:08 PM, Marc Delisle <span dir="ltr"><<a href="mailto:marc@infomarc.info" target="_blank">marc@infomarc.info</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le 2014-07-24 06:01, Ashutosh Dhundhara a écrit :<br>
<div class="">> On Thu, Jul 24, 2014 at 5:32 PM, Marc Delisle <<a href="mailto:marc@infomarc.info">marc@infomarc.info</a><br>
</div><div class="">> <mailto:<a href="mailto:marc@infomarc.info">marc@infomarc.info</a>>> wrote:<br>
><br>
>     Le 2014-07-23 22:39, Hugues Peccatte a écrit :<br>
>     > 2014-07-23 20:22 GMT+02:00 Ashutosh Dhundhara<br>
>     > <<a href="mailto:ashutoshdhundhara@yahoo.com">ashutoshdhundhara@yahoo.com</a> <mailto:<a href="mailto:ashutoshdhundhara@yahoo.com">ashutoshdhundhara@yahoo.com</a>><br>
</div>>     <mailto:<a href="mailto:ashutoshdhundhara@yahoo.com">ashutoshdhundhara@yahoo.com</a><br>
<div><div class="h5">>     <mailto:<a href="mailto:ashutoshdhundhara@yahoo.com">ashutoshdhundhara@yahoo.com</a>>>>:<br>
>     ><br>
>     >     Hi,<br>
>     ><br>
>     >     This is in regards with RFE #919<br>
>     >     <<a href="http://sourceforge.net/p/phpmyadmin/feature-requests/919/" target="_blank">http://sourceforge.net/p/phpmyadmin/feature-requests/919/</a>><br>
>     (Multiple-column<br>
>     >     foreign key relation). I was trying to figure out the UI for<br>
>     this by<br>
>     >     modifying the existing one. I have attached a screenshot for<br>
>     the same.<br>
>     >     Please comment.<br>
>     ><br>
>     >     --<br>
>     >     Ashutosh Dhundhara<br>
>     ><br>
>     ><br>
>     > Hi,<br>
>     ><br>
>     > This is nice.<br>
>     > IMO the constraint name should be displayed as a title, and not<br>
>     > displayed in the bottom-right corner, so you will see it easily.<br>
>     > Maybe, you can reduce table rows height, by displaying the ON<br>
>     UPDATE and<br>
>     > DELETE on the same line.<br>
>     ><br>
>     > Hugues.<br>
><br>
>     Hi Ashutosh,<br>
>     somehow I missed your initial email but saw the screenshot in the<br>
>     archives.<br>
><br>
>     The UI you are proposing does not work, in my opinion. On the left side,<br>
>     you are proposing multiple columns, but the feature request is about<br>
>     having, on the left side, one column, and on the foreign key constraint<br>
>     side (right), multiple columns.<br>
><br>
><br>
> Hi Marc,<br>
><br>
> can you please quote an example of this case?<br>
><br>
> Are you talking about a case like this:<br>
><br>
> Lets say I have two tables `table_1` and `table_2` with two columns `id`<br>
> and `value`.<br>
> The query:<br>
> ALTER TABLE `table_2` ADD FOREIGN KEY (`id`) REFERENCES `table_1` (`id`,<br>
> `value`);<br>
<br>
</div></div>Hi Ashutosh,<br>
yes, I was thinking about a case like this but I reverified in<br>
<a href="http://dev.mysql.com/doc/refman/5.5/en/create-table-foreign-keys.html" target="_blank">http://dev.mysql.com/doc/refman/5.5/en/create-table-foreign-keys.html</a><br>
and it does not look to be possible.<br>
<br>
So your UI is correct, in general, except that I suggest that instead of<br>
numbering the relations (1, 2), you just use some visual divider like a<br>
horizontal line. Numbering would introduce a doubt about the order of<br>
the foreign keys, which does not exist (each FK is independent from the<br>
others).<br></blockquote><div><br></div><div>Yeah, you are right. This looks a bit confusing. I will try some visual divider.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
I have a few questions about your screenshot:<br>
<br>
- Does it represent the case when a user is trying to add constraints to<br>
table_2 ?<br></blockquote><div><br></div><div>Yes. This represents the case when user is trying to add constraints to `table_2`.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
- Why did the user match table_1.value for the id column, and <a href="http://table_1.id" target="_blank">table_1.id</a><br>
for the value column? Taking the MySQL manual as an example, it's much<br>
easier to understand this:<br>
<br>
FOREIGN KEY (product_category, product_id)<br>
      REFERENCES product(category, id)</blockquote><div><br></div><div> Yes Marc, your example is relevant. I did this because my table structures were as follows:</div><div><br></div><div>`table_1`</div><div>id      : int</div>
<div>value : varchar</div><div><br></div><div>`table_2`</div><div>id      : varchar</div><div>value : int</div></div><br>Thats why <a href="http://table_2.id">table_2.id</a> is compatible with <a href="http://table_1.id">table_1.id</a>.</div>
<div class="gmail_extra">I will share another improved UI screenshot soon.<br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Ashutosh Dhundhara</div></div>
</div></div>