<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jul 8, 2014 at 9:04 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Le 2014-07-08 10:48, Ashutosh Dhundhara a écrit :<br>
<div class="">> On Tue, Jul 8, 2014 at 6:01 PM, Marc Delisle <<a href="mailto:marc@infomarc.info">marc@infomarc.info</a><br>
</div><div><div class="h5">> <mailto:<a href="mailto:marc@infomarc.info">marc@infomarc.info</a>>> wrote:<br>
><br>
>     Le 2014-07-08 07:52, Ashutosh Dhundhara a écrit :<br>
>     > Hi,<br>
>     ><br>
>     > I have got some ideas regarding RFE #908<br>
>     > <<a href="http://sourceforge.net/p/phpmyadmin/feature-requests/908/" target="_blank">http://sourceforge.net/p/phpmyadmin/feature-requests/908/</a>><br>
>     (Improvements for<br>
>     > the table editor (index creation)).<br>
>     ><br>
>     > *_1. Making Column section on 'Add Index' dialog sort-able._*<br>
>     > With this user will be able to change the order of columns in case of<br>
>     > composite keys.<br>
>     ><br>
>     > *_2. Displaying a dialog box when multiple columns for same type of<br>
>     > index are selected on 'Create table' page._*<br>
>     > This dialog will have two options: 'Create new' and 'Create<br>
>     composite'.<br>
>     > - 'Create new' will allow user to create a new single column key.<br>
>     (Table<br>
>     > can have only one Primary key)<br>
>     > - 'Create composite' will allow user to add that column to a existing<br>
>     > key (to be created) and sort the order of columns.<br>
>     ><br>
>     > Will this implement this feature request?<br>
><br>
>     Hi Ashutosh,<br>
>     first, the feature request says "If I add two indexed fields to a<br>
>     table"; remember that this action can be done on initial table creation,<br>
>     and when adding columns on an existing table.<br>
><br>
><br>
> Thanks for pointing this out. I missed that 'adding column on an<br>
> existing table' part.<br>
><br>
><br>
><br>
>     About your suggestion #1, are you talking about the dialog that appears<br>
>     after choosing table Structure > Indexes > Create an index on x columns<br>
>     ? If so, the user can already choose the columns in the correct order;<br>
>     so you want to help the user change his mind when creating the index?<br>
><br>
>     I am not against, but this would be more useful when _editing_ an index.<br>
>     Or it can be done in both situations.<br>
><br>
><br>
><br>
> Yeah, this can be done with the existing system. I failed to see that.<br>
<br>
</div></div>I mean, calling the existing index editor (improved with the sortable<br>
columns), when adding the columns with an index choice selected.<br></blockquote><div><br></div><div>But the user can still change the order of columns using the select lists on the 'Edit Index' dialog.</div><div>
 </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="">><br>
><br>
>     About your suggestion #2, if the user chose PRIMARY in the selector for<br>
>     two columns, it makes no sense to show this additional dialog (unless<br>
>     you want him to confirm that the PRIMARY will be composite) but it makes<br>
>     sense to allow column sorting.<br>
><br>
><br>
> Yeah Marc, I won't show this dialog for PRIMARY key.<br>
<br>
</div>But if the user wants to create a composite primary key, I expect that<br>
you will show the dialog for choosing the index order.<br></blockquote><div><br></div><div>Yeah, I will do that.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class="">><br>
><br>
><br>
>     If he chose UNIQUE or INDEX, instead of "Create new" I would say "Create<br>
>     single-column indexes". The other message could be "Create a composite<br>
>     index" but do you suggest that this choice opens the already-existing<br>
>     Edit index dialog, which you would prefill with the chosen column names?<br>
><br>
>     As per the feature request, the default choice should be to create<br>
>     single-column indexes.<br>
><br>
><br>
> I think you are getting it wrong. This part is for 'Create table' page<br>
> and 'add column to existing table' page. Lets say I am creating a new<br>
> table. I have added a column `col1` and selected UNIQUE index for it<br>
> (before clicking 'Go'). I won't see any dialog yet. Now lets I have<br>
> added another column `col2` and selected UNIQUE index for this as well.<br>
> Now I will get a dialog asking for "Create single-column indexes" or<br>
> "Create a composite index". If I will choose "Create a composite index",<br>
> then I will get a list of all temporary UNIQUE indexes and I can merge<br>
> that column into any of these indexes.<br>
> For PRIMARY index, we will need only the composite-index part.<br>
<br>
</div>But the create table form can still change before submission. What<br>
happens if the user goes back to col1 and unselects UNIQUE?<br></blockquote><div><br></div><div>We can remove that column from the corresponding indexes and add it a new as before.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class=""><br>
><br>
> I think this will also handle the issue highlighted by you in the next mail?<br>
<br>
</div>Not sure, it depends on the moment when the user uses the index selector<br>
and for which column.<br>
<div class="im"><br></div></blockquote></div><div class="gmail_extra"><br></div>Lets user first selects INDEX for col a (no dialog box yet); then selects INDEX for col b too and he gets a dialog box. Then he adds col b with col a's index by choosing "Create a composite index" option. And finally he selects UNIQUE for col c and again he gets a dialog box. Then he chooses "Create single-column indexes" option. In this way he can get composite-index for a + b and single index on c. Is this the case you are referring?<br>
<br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Ashutosh Dhundhara</div></div>
</div></div>