Bug #37265 synchronize drops any SPs that were created outside of Mysql Workbench
Submitted: 7 Jun 2008 22:59 Modified: 9 Jun 2008 11:37
Reporter: Greg Lincoln Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.0.22 OS:Any
Assigned to: CPU Architecture:Any

[7 Jun 2008 22:59] Greg Lincoln
Description:
I created a stored procedure using an alternate tool. When I made changes to the data schema later in Workbench, and chose "synchronize," it dropped my SP.

How to repeat:
I was able to repeat this easily by adding the SP back. If I fail to disable Stored Procedure "sync," it will delete my SPs every time. 

Suggested fix:
Sync should be sync. If you really don't mean it to sync, let me disable SP deletion permanently. I can disable syncing them as a one off, but if I ever forget, I'll lose all my SPs.
[9 Jun 2008 11:04] Johannes Taxacher
Hello Greg,

when you run sync the function does a synchronisation from model towards DB - per default. so when there are objects in the database which don't exist in the database (yet) those would be deleted (again: per default).

you've got 2 choices:
- as you already mentioned, exclude those objects via filterpage (but as you wrote, you have to do this on every sync then)
- change sync-direction for objects you want synched back to your model (this can be done on the sync-wizard-page called "SQL Diff Tree" by double clicking the synch direction arrow between each object). this fetches the objects (SP, tables, etc.) that are missing in model into your document.

i hope this info is what you've been looking for. if not, please provide some more info on how it should work.

thanks for your input.
[9 Jun 2008 11:21] Johannes Taxacher
sorry, i have to correct the introduction sentence of my previous post. did mess up some words:

when you run sync the function does a synchronisation from model towards DB - per default.
so when there are objects in the database which don't exist in the model (yet) those
in DB would be deleted (again: per default).
[9 Jun 2008 11:37] Greg Lincoln
Okay. I guess I just expected sync to make the two of them the same taking into account which had been changed last. Since the SP was added after my last sync, my expectation was that it would sync that change back to my model in SQL Workbench by default.

I didn't know about the direction changing thingie. That will help as I can just pull the SPs over. Thanks!

I still think you should consider changing this behavior, though. :)