在 MySQL Workbench 中同步模型
阅读 MySQL Workbench 的文档后,我的印象是可以更改服务器中的数据库(例如添加新列),然后将 DDL 更改合并到 EER 图中。至少,它的“数据库”菜单中有一个“同步模型”选项。我发现它是一个很好的功能,因为我可以使用图形建模工具而不会成为它的囚徒。
在实践中,当我运行这样的工具时,我会得到以下选项:
Model Update Source
================ ====== ======
my_database_name --> ! N/A
my_table_name --> ! N/A
N/A --> ! my_database_name
N/A --> ! my_table_name
我无法真正理解它,但保持原样我基本上得到:
DROP SCHEMA my_database_name
CREATE SCHEMA my_database_name
CREATE TABLE my_table_name
这是模型的转储,覆盖 my_table_name 中的所有远程更改。
我是否误解了该功能?
After reading the documentation for MySQL Workbench I got the impression that it's possible to alter a database in the server (e.g. add a new column) and later incorporate the DDL changes into your EER diagram. At least, it has a Synchronize Model option in the Database menu. I found it a nice feature because I could use a graphic modelling tool without becoming its prisoner.
In practice, when I run such tool I'm offered these options:
Model Update Source
================ ====== ======
my_database_name --> ! N/A
my_table_name --> ! N/A
N/A --> ! my_database_name
N/A --> ! my_table_name
I can't really understand it, but leaving it as is I basically get:
DROP SCHEMA my_database_name
CREATE SCHEMA my_database_name
CREATE TABLE my_table_name
This is a dump of the model that overwrites all remote changes in my_table_name.
Am I misunderstanding the feature?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是您可以跟踪的真正错误。 http://bugs.mysql.com/bug.php?id=61211一位 mysql QA 人员提出了一种解决方法:
一种解决方法是打开 Scripting Shell,检查模式名称并进行
确保 oldName 字段包含与您要同步的名称相同的名称
反对。
其命令是:
Here is the real bug that you can follow. http://bugs.mysql.com/bug.php?id=61211 And there is a workaround from one of the mysql QA people:
A workaround is to open the Scripting Shell, inspect the name of the schema and make
sure that the oldName field contains the same name as what you're trying to synchronize
against.
Commands for that are:
诚实地?我认为这是一个错误。我多次遇到同样的问题,但不确定问题是什么。
我建议检查 bug 存储库,如果您没有找到任何内容,请将其报告为新的。
Honestly? I think it's a bug. I've run into the same problem on several occasions and I'm not sure what the issue is.
I suggest checking the bug repository and, if you don't find anything, reporting this as a new one.
我总是多次使用同步成功!但今天我遇到了同样的问题 - 想知道方法吗?
所以我研究了MySQL的BUG报告并发现了问题......
数据库名称中不要使用大写或下划线
所以我是:
它有效! ...现在我必须更改 applicationconfig 中数据库的名称...
I always use the synchronization successful several times! But today I have the same problem - and wonder way?
So I study the BUG-Report by MySQL and find the problem...
Don't use caps or underscore in the name of the database
So I am:
And it works! ... now I have to change the name of the database in the applicationconfig ...