Bug #34408 unable to create a prmary index on imported table
Submitted: 8 Feb 2008 10:17 Modified: 25 Feb 2008 18:55
Reporter: Chris Hamono Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.0.13 OS:Windows (xp)
Assigned to: Johannes Taxacher CPU Architecture:Any
Tags: primary index

[8 Feb 2008 10:17] Chris Hamono
Description:
If you import a table using import from mysql create script that doesn't have a primary key defined there is no way to add a primary key afterwards

How to repeat:
create a create table definition without a primary key

Import that table definition

try to create a Primary key either by creating a new column or altering an existing index
[8 Feb 2008 11:12] MySQL Verification Team
Thank you for the bug report.
[13 Feb 2008 17:48] Alfredo Kojima
Hi

Have you tried double clicking the icon at left of the column
in the columns list in table editor? That should toggle the column 
between PK and normal.
[13 Feb 2008 22:49] Chris Hamono
Clicking the icon in the column list in the columns tab successfully changed the primary key, it allowed me to both add and remove primary keys.

Its not obvious that this icon performs any task other than advisory. 
The Primary Key cannot be altered, added or removed in the Indexes Tab, so the only method available is clicking this icon.

Thanks for the advice.
[19 Feb 2008 18:10] Johannes Taxacher
lowered severity because it wasn't actually a bug, but left the report open because we're about to improve the UI for this feature to make it more obvious.
[22 Feb 2008 18:32] Alfredo Kojima
A checkbox was added to the flags section of the column to toggle PK. Hopefully
that will be more intuitive.
[22 Feb 2008 18:49] Johannes Taxacher
works as described by developer. 
Doubleclicking the column-icon is still a method to add/remove the column to/from PK. Additionally now one can also use the Checkbox "PRIMARY KEY" that appears in the Flags-box when a column-line is selected in Table-Editor.
[22 Feb 2008 22:20] Chris Hamono
Please excuse me for being quizzical, but wouldnt fixing the indexes tab be more logical than the columns tab?

While I agree the columns tab is a great way for "quick changes" to the primary key, the primary key is after all an index and the proper (and logical) place to change it should be the indexes tab.

I understand the functionality already appears to be in the columns tab code, and so what you have done is a quick fix, but from the discussion it just seems to be the only fix.
[25 Feb 2008 18:55] Peter Lavin
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.
Added to the changelog and noted in the body of the documentation.