Bug #54350 table order in create script should either be alphabetical or foreign key order
Submitted: 8 Jun 2010 19:53 Modified: 31 Jul 2013 22:40
Reporter: pete watters Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:5.2.22 oss rc rev 6091 OS:Any
Assigned to: CPU Architecture:Any
Tags: forward engineer, sql create script

[8 Jun 2010 19:53] pete watters
Description:
In the dbdesigner product I had some control on the sequence the tables would be created in... 
Alphabetical or in foreign key order - 
The WorkBench order seems arbitary - this makes it very difficult to see how the data model has changed via comparing versions of the create script. 
We put in the datamodel file (the xml output of dbdesigner) and the corresponding create script under revision control.

How to repeat:
workbench->data modeling->file->export->forward engineer SQL Create script

Suggested fix:
offer a check box at the options dialog to output tables in foreign key order-
or if there are more options than alphabetical and foreign key - then a radio button or pull down list.

-OR-

Put this control on the Filter dialog

then generate create script in that order
[8 Jun 2010 21:45] MySQL Verification Team
Thank you for the bug report.
[7 Aug 2011 8:22] Adam S
This bug appears very similar to this one:
http://bugs.mysql.com/bug.php?id=60566

I second the check box for either foreign key order or alphabetical order.

I believe options are needed.  Since the mwb file is binary, we save a copy of the export in our revision control system in order to see changes.  This works fine if the tables are kept in the same order, but if they change, then it's difficult to see exact changes to specific tables.

In the case that just happened to me, I added a key to a table, and the export decided it wanted it in an entirely different spot.  Now a diff of the old and new file shows a huge chunk changing rather than just the line for the added key.
[31 Jul 2013 22:40] pete watters
I see that the target is wb53 but I downloaded wb 6.0 and it still has the same issue. This problem is preventing me from using this product.