Bug #19753 There is no way to insert a new column between two existing columns
Submitted: 12 May 2006 7:25 Modified: 12 May 2006 8:14
Reporter: Stefaan Lesage (Basic Quality Contributor) Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Workbench Preview Severity:S2 (Serious)
Version:1.0.6 Beta OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[12 May 2006 7:25] Stefaan Lesage
Description:
If you have a talbe with some columns in it, and you want to insert a new columns between 2 other columns you seem to be out of luck :-(

How to repeat:
Open a new Model
Drop a new Table
Edit the table and add 2 fields F_ITEM_ID and F_ITEM_NAME for example.
Now you notice that you forgot the F_ITEMTYPE_ID which should come after F_ITEM_ID and before F_ITEM_NAME, sadly you can only add the column at the end of the table.
When the Column is added at the end of the table, you can't seem to reposition it in the model neither.

Suggested fix:
In the Table Editor where you have the list of columns, there is a Popup Menu with 2 options : 'Delete Selected Items' ( which seems to be always disabled btw ) and 'Show Advanced Controls'.

Add 2 additional options here : 

'Add new Column' which would add the column at the end of the list of columns ( mabe call it append )
'Insert new Column' ( only available when a column is selected ) which would add the new column before the currently selected column.

Would be nice if those options also have a keyboard shortcut ( INSERT for Add and CTRL + INSERT for the INSERT mayber ?? ).
[12 May 2006 7:27] Stefaan Lesage
Hm, this is rather problematic.  The only solution I found for my problem is to add the field at the end of my table, save the model, then open up the model using some text editor and reposition the column where it should be.
[18 Aug 2006 17:03] Kenny DeWitt
to add a column between two columns 
alter table {db_name}.{table_name} add {column_name} {column_type} after {the column_name you want the new column to be};
[18 Aug 2006 18:08] Kenny DeWitt
next to
[27 Nov 2007 5:32] satish moka
Hi Kenny,

        YOu have provided useful information to me..,thank you.