Bug #70651 Issue with identical "original target table" on two many-to-many tables
Submitted: 17 Oct 2013 17:41 Modified: 16 Feb 2016 14:44
Reporter: Rasmus Schultz Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S2 (Serious)
Version:6.0.7 OS:Windows (Windows 8)
Assigned to: CPU Architecture:Any

[17 Oct 2013 17:41] Rasmus Schultz
Description:
The "Synchronize Model" function fails to migrate one of two created many-to-many tables, between the same two parent tables, when those tables are created at the same time.

How to repeat:
Create two parent tables - in my case "project" and "person".

Synchronize the model (or forward engineer) to create the two parent tables.

Use the n:m tool to create two many-to-many link-tables between "project" and "person" - in my case, I name these tables "quality_reviewer" and "safety_reviewer".

Now synchronize the model to create the link-tables - the "model and database differences" screen will show the SQL for only one of the link-tables; the other one will show up empty, as though no changes had been made, even though neither of these tables exist yet.

Click on "table mapping" and inspect the two link-tables - both of them show "original target table" as "project_person", which is incorrect, and is most likely the source of this problem.

Suggested fix:
As far as I can figure, there is no "original target table", since these tables have never been deployed yet - MWB seems to assume that whatever the original table-name that was generated by the n:m tool is also the table it was originally targeting, but I don't think this assumption can be made before the table is actually deployed (either by synchronizing the model or forward engineering it) for the first time?

Not sure if this is the right approach to fixing this problem.

Workaround:

Deploy the tables by forward engineering only those two tables - this will cause the "original target table" to correctly set itself, and model synchronization will work normally for those tables afterwards.
[12 Feb 2016 8:55] Mike Lischke
Has this problem been solved in the latest WB version (6.3.6)?
[13 Feb 2016 16:04] Rasmus Schultz
Sorry, I haven't used MWB in years.

But there are step-by-step instructions to repeat the issue, so it shouldn't be too difficult to re-test?
[16 Feb 2016 14:44] Milosz Bodzek
Can't repeat on 6.3.6