Bug #70130 Synch generate drop for all tables except fake
Submitted: 23 Aug 2013 5:55 Modified: 23 Jan 2014 5:57
Reporter: Stas V Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any
Tags: external database, foreign keys, modeling

[23 Aug 2013 5:55] Stas V
Description:
Bug is connected with #61440
I created foreign key for a custom table that is not inside schema, it created "fake" database and "model-only-stub" table within it.
However, when I tried to synch, workbench suggested me to DROP all tables except the fake one.

How to repeat:
1) Create new model
2) Create new table
3) Create foreign key within this table pointing to external database (not in this mwb). This external database should have more than 1 table inside.
4) Synch model. (It will generate drop sql for all tables in that database except one)

Suggested fix:
Mark databases as "model-only stubs" too to prevent synchronization on tables that are within that database.
[22 Jan 2014 22:14] Alfredo Kojima
I'm having difficulties reproducing this, could you attach a sample model that shows the problem?
[23 Jan 2014 5:50] Stas V
workbench file

Attachment: new_mwb.mwb (application/octet-stream, text), 5.85 KiB.

[23 Jan 2014 5:50] Stas V
Screenshot

Attachment: Synch screen.png (image/png, text), 68.21 KiB.

[23 Jan 2014 5:51] Stas V
sql for existing database

Attachment: existing_database.sql (application/octet-stream, text), 1.13 KiB.

[23 Jan 2014 5:57] Stas V
Its more workflow issue than a bug.
Workbench doesn't know some databases are created only to hold fake tables. so when we link a table from new database to existing one, it will create a fake version of existing database inside mwb. Next time we synch, it will put checkbox on it by default. Therefore in certain cases it will generate sql to drop all tables in previous database except one that it will reduce to one column.