Bug #32749 Renaming column created by foreign key relationship not renamed in HTML report
Submitted: 27 Nov 2007 2:15 Modified: 29 Nov 2007 16:35
Reporter: Graham Nott Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.0.9 Beta OS:Windows (XP Pro SP2)
Assigned to: Johannes Taxacher CPU Architecture:Any
Tags: colum, foreign key, HTML, relationship, rename, report, reporting

[27 Nov 2007 2:15] Graham Nott
Description:
When creating a relationship between two tables using the EER Diagram pane, the primary key column of one table is added to the other table as a foreign key column. If the user renames the foreign key column, the new name does not show up on the HTML Report using the Reporting... feature for the index created on that column. Instead, the original name for the column generated by Workbench is displayed for the column on which the index is created.

Saving the Workbench file and re-opening it does not fix it. SQL generated from the model uses the correct name of the column to create the index.

How to repeat:
1. Open Workbench
2. Add Diagram
3. Add a table "table1", with "idtable1" column int not null auto_increment primary key.
4. Add a second table "table2", with "idtable2" column int not null auto_increment primary key.
5. Place a new 1:n non-identifying relationship from table1 to table2
6. Rename the column created for the foreign key in table1 to idtable2.
7. Go to Model->Reporting..., and click the Finish button.
8. View the report in the web browser. 
9. Under the Indicies heading for table1, the fk_table1_table2_index  says it is for column 'table2_idtable2' (listed under Columns). It should read 'idtable2'.

Suggested fix:
Display the name of the column in the table for the column that is indexed, not the default name of the column. I cannot read the binary format of the Workbench files, so I'm unable to confirm if there's some duplicate out-of-date name for the column saved in the file itself.
[27 Nov 2007 4:49] Valeriy Kravchuk
Thank you for a detailed bug report. Verified just as described.
[27 Nov 2007 18:30] Alfredo Kojima
Changed reporting code to use refered index column name.
[29 Nov 2007 16:35] Johannes Taxacher
works in 5.0.9 SVN rev 2259